Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -20,8 +20,9 @@ |
21 | 21 | * - timeout Timeout length in seconds |
22 | 22 | * - postData An array of key-value pairs or a url-encoded form data |
23 | 23 | * - proxy The proxy to use. |
24 | | - * Will use $wgHTTPProxy (if set) otherwise. |
25 | | - * - noProxy Override $wgHTTPProxy (if set) and don't use any proxy at all. |
| 24 | + * Otherwise it will use $wgHTTPProxy (if set) |
| 25 | + * Otherwise it will use the environment variable "http_proxy" (if set) |
| 26 | + * - noProxy Don't use any proxy at all. Takes precedence over proxy value(s). |
26 | 27 | * - sslVerifyHost (curl only) Verify hostname against certificate |
27 | 28 | * - sslVerifyCert (curl only) Verify SSL certificate |
28 | 29 | * - caInfo (curl only) Provide CA information |
— | — | @@ -286,11 +287,11 @@ |
287 | 288 | public function proxySetup() { |
288 | 289 | global $wgHTTPProxy; |
289 | 290 | |
290 | | - if ( $this->proxy ) { |
| 291 | + if ( $this->proxy && !$this->noProxy ) { |
291 | 292 | return; |
292 | 293 | } |
293 | 294 | |
294 | | - if ( Http::isLocalURL( $this->url ) ) { |
| 295 | + if ( Http::isLocalURL( $this->url ) || $this->noProxy ) { |
295 | 296 | $this->proxy = ''; |
296 | 297 | } elseif ( $wgHTTPProxy ) { |
297 | 298 | $this->proxy = $wgHTTPProxy ; |
— | — | @@ -401,9 +402,11 @@ |
402 | 403 | $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) ); |
403 | 404 | } |
404 | 405 | |
405 | | - if ( !$this->noProxy ) { |
406 | | - $this->proxySetup(); |
407 | | - } |
| 406 | + /** |
| 407 | + * Set up the proxy, but |
| 408 | + * clear the proxy when $noProxy is set (takes precedence) |
| 409 | + */ |
| 410 | + $this->proxySetup(); |
408 | 411 | |
409 | 412 | if ( !$this->callback ) { |
410 | 413 | $this->setCallback( array( $this, 'read' ) ); |