Fixes Bug #28277 by allowing redirects on the stream reader. Fixes a
authorMark A. Hershberger <mah@users.mediawiki.org>
Thu, 27 Oct 2011 17:58:30 +0000 (17:58 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Thu, 27 Oct 2011 17:58:30 +0000 (17:58 +0000)
regression where pages specifying a w:en:Sprint would result in a url
like http://pt.wikipedia.org/wiki/en:Special:Export/Sprint which, at
least in 1.16, would mean the reader follow the redirect to
http://en.wikipedia.org/wiki/Special:Export/Sprint.

includes/Import.php

index 502b015..dfbd522 100644 (file)
@@ -1518,7 +1518,7 @@ class ImportStreamSource {
                # quicker and sorts out user-agent problems which might
                # otherwise prevent importing from large sites, such
                # as the Wikimedia cluster, etc.
-               $data = Http::request( $method, $url );
+               $data = Http::request( $method, $url, array( 'followRedirects' => true ) );
                if( $data !== false ) {
                        $file = tmpfile();
                        fwrite( $file, $data );