Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | * Returns true if there was an error, false otherwise |
157 | 157 | */ |
158 | 158 | private function curlCopy( $url, $dest ) { |
159 | | - global $wgUser, $wgOut; |
| 159 | + global $wgUser, $wgOut, $wgHTTPProxy; |
160 | 160 | |
161 | 161 | if( !$wgUser->isAllowed( 'upload_by_url' ) ) { |
162 | 162 | $wgOut->permissionRequired( 'upload_by_url' ); |
— | — | @@ -183,6 +183,9 @@ |
184 | 184 | curl_setopt( $ch, CURLOPT_TIMEOUT, 10); # 10 seconds timeout |
185 | 185 | curl_setopt( $ch, CURLOPT_LOW_SPEED_LIMIT, 512); # 0.5KB per second minimum transfer speed |
186 | 186 | curl_setopt( $ch, CURLOPT_URL, $url); |
| 187 | + if( $wgHTTPProxy ) { |
| 188 | + curl_setopt( $ch, CURLOPT_PROXY, $wgHTTPProxy ); |
| 189 | + } |
187 | 190 | curl_setopt( $ch, CURLOPT_WRITEFUNCTION, array( $this, 'uploadCurlCallback' ) ); |
188 | 191 | curl_exec( $ch ); |
189 | 192 | $error = curl_errno( $ch ) ? true : false; |
Index: trunk/extensions/MWSearch/MWSearch_body.php |
— | — | @@ -463,10 +463,14 @@ |
464 | 464 | } |
465 | 465 | } |
466 | 466 | |
| 467 | + // Search server will be in local network but may not trigger checks on |
| 468 | + // Http::isLocal(), so suppress usage of $wgHTTPProxy if enabled. |
| 469 | + $curlOpts = array( CURLOPT_PROXY => '' ); |
| 470 | + |
467 | 471 | wfDebug( "Fetching search data from $searchUrl\n" ); |
468 | 472 | wfSuppressWarnings(); |
469 | 473 | wfProfileIn( $fname.'-contact-'.$host ); |
470 | | - $data = Http::get( $searchUrl, $wgLuceneSearchTimeout ); |
| 474 | + $data = Http::get( $searchUrl, $wgLuceneSearchTimeout, $curlOpts ); |
471 | 475 | wfProfileOut( $fname.'-contact-'.$host ); |
472 | 476 | wfRestoreWarnings(); |
473 | 477 | if( $data === false ) { |