]> granicus.if.org Git - php/commitdiff
Fix proxy detection with the xmlrpc C extension
authorTomas V.V.Cox <cox@php.net>
Mon, 4 Aug 2003 11:18:26 +0000 (11:18 +0000)
committerTomas V.V.Cox <cox@php.net>
Mon, 4 Aug 2003 11:18:26 +0000 (11:18 +0000)
pear/PEAR/Remote.php

index 7eaa26c8bab55c839e98780fb4c1bfe68b1ccde6..eca2c384098db6eeae778952f36483c94606be70 100644 (file)
@@ -201,19 +201,18 @@ class PEAR_Remote extends PEAR
             return $this->raiseError("PEAR_Remote::call: no master_server configured");
         }
         $server_port = 80;
-        $proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';
-        if ($proxy = parse_url($this->config->get('http_proxy'))) {
+        if ($http_proxy = $this->config->get('http_proxy')) {
+            $proxy = parse_url($http_proxy);
+            $proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';
             $proxy_host = @$proxy['host'];
             $proxy_port = @$proxy['port'];
             $proxy_user = @$proxy['user'];
             $proxy_pass = @$proxy['pass'];
-        }
-        if ($proxy != '') {
             $fp = @fsockopen($proxy_host, $proxy_port);
         } else {
             $fp = @fsockopen($server_host, $server_port);
         }
-        if (!$fp && $proxy_host != '') {
+        if (!$fp && $http_proxy) {
             return $this->raiseError("PEAR_Remote::call: fsockopen(`$proxy_host', $proxy_port) failed");
         } elseif (!$fp) {
             return $this->raiseError("PEAR_Remote::call: fsockopen(`$server_host', $server_port) failed");