From: Tomas V.V.Cox Date: Mon, 4 Aug 2003 11:18:26 +0000 (+0000) Subject: Fix proxy detection with the xmlrpc C extension X-Git-Tag: RELEASE_1_2b5~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4e50ffba7efa7069b0fb25917c6c028e0eac3df;p=php Fix proxy detection with the xmlrpc C extension --- diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php index 7eaa26c8ba..eca2c38409 100644 --- a/pear/PEAR/Remote.php +++ b/pear/PEAR/Remote.php @@ -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");