X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fimport%2FImportStreamSource.php;h=0c12ebb60f8f0f67f6e161653010518adc879fc7;hb=c62e736f183abc62f9b80fcf2703f1a9d8bd379a;hp=0e03d9fbcef424cdb0c8d2a7008d4bec57a7b528;hpb=e4854a1f0057ac344e2b5c6656ac186fcd8dc3fa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/import/ImportStreamSource.php b/includes/import/ImportStreamSource.php index 0e03d9fbce..0c12ebb60f 100644 --- a/includes/import/ImportStreamSource.php +++ b/includes/import/ImportStreamSource.php @@ -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, array( 'followRedirects' => true ), __METHOD__ ); + $data = Http::request( + $method, + $url, + [ + 'followRedirects' => true, + 'timeout' => $wgHTTPImportTimeout + ], + __METHOD__ + ); if ( $data !== false ) { $file = tmpfile(); fwrite( $file, $data ); @@ -154,7 +163,7 @@ class ImportStreamSource implements ImportSource { $link = $firstIw->getURL( strtr( "${additionalIwPrefixes}Special:Export/$page", ' ', '_' ) ); - $params = array(); + $params = []; if ( $history ) { $params['history'] = 1; }