From 5c8245acdffd8ff5f52638b85520c54b0aed6b9b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 18 Jan 2013 10:55:01 -0800 Subject: [PATCH] Http function logic cleanups and comments. Change-Id: Ibe309246960491958870610f69c253bf3ccc1637 --- includes/HttpFunctions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index ab27a7437d..b1092df88f 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -328,10 +328,13 @@ class MWHttpRequest { public function proxySetup() { global $wgHTTPProxy; - if ( $this->proxy || !$this->noProxy ) { + // If there is an explicit proxy set and proxies are not disabled, then use it + if ( $this->proxy && !$this->noProxy ) { return; } + // Otherwise, fallback to $wgHTTPProxy/http_proxy (when set) if this is not a machine + // local URL and proxies are not disabled if ( Http::isLocalURL( $this->url ) || $this->noProxy ) { $this->proxy = ''; } elseif ( $wgHTTPProxy ) { -- 2.20.1