Http function logic cleanups and comments.
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Jan 2013 18:55:01 +0000 (10:55 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Jan 2013 18:55:11 +0000 (10:55 -0800)
Change-Id: Ibe309246960491958870610f69c253bf3ccc1637

includes/HttpFunctions.php

index ab27a74..b1092df 100644 (file)
@@ -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 ) {