diff options
| author | Tomas V.V.Cox <cox@php.net> | 2003-08-04 11:18:26 +0000 |
|---|---|---|
| committer | Tomas V.V.Cox <cox@php.net> | 2003-08-04 11:18:26 +0000 |
| commit | d4e50ffba7efa7069b0fb25917c6c028e0eac3df (patch) | |
| tree | 46beffd69ba41d6d98c3fe6607c16e0c78691247 | |
| parent | 2884e8a7154e3cea16198170d90983ddbf60a029 (diff) | |
| download | php-git-d4e50ffba7efa7069b0fb25917c6c028e0eac3df.tar.gz | |
Fix proxy detection with the xmlrpc C extension
| -rw-r--r-- | pear/PEAR/Remote.php | 9 |
1 files changed, 4 insertions, 5 deletions
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"); |
