Merge "Add tagging support to imagerotate, revisiondelete, and tag API modules"
[lhc/web/wiklou.git] / includes / import / ImportStreamSource.php
index e2e8dd5..0c12ebb 100644 (file)
@@ -104,12 +104,21 @@ class ImportStreamSource implements ImportSource {
         * @return Status
         */
        static function newFromURL( $url, $method = 'GET' ) {
+               global $wgHTTPImportTimeout;
                wfDebug( __METHOD__ . ": opening $url\n" );
                # Use the standard HTTP fetch function; it times out
                # 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, [ 'followRedirects' => true ], __METHOD__ );
+               $data = Http::request(
+                       $method,
+                       $url,
+                       [
+                               'followRedirects' => true,
+                               'timeout' => $wgHTTPImportTimeout
+                       ],
+                       __METHOD__
+               );
                if ( $data !== false ) {
                        $file = tmpfile();
                        fwrite( $file, $data );