summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2003-10-16 18:16:38 +0000
committerPierre Joye <pajoye@php.net>2003-10-16 18:16:38 +0000
commit64e499aaefc900b0e32a52bf13307f1d18957f8e (patch)
treee750731ea2d2fa885f97134e3ce267bcc85ad564
parent1459361c3e6b1e346725809fdc41c36b798bd43f (diff)
downloadphp-git-64e499aaefc900b0e32a52bf13307f1d18957f8e.tar.gz
- Fix RPC call without proxy (silence warnings&notices)
nota bene: the proxy codes should be cleaned, one day ;)
-rw-r--r--pear/PEAR/Remote.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php
index eca2c38409..b49b674d2c 100644
--- a/pear/PEAR/Remote.php
+++ b/pear/PEAR/Remote.php
@@ -209,7 +209,9 @@ class PEAR_Remote extends PEAR
$proxy_user = @$proxy['user'];
$proxy_pass = @$proxy['pass'];
$fp = @fsockopen($proxy_host, $proxy_port);
+ $use_proxy = true;
} else {
+ $use_proxy = false;
$fp = @fsockopen($server_host, $server_port);
}
if (!$fp && $http_proxy) {
@@ -234,7 +236,7 @@ class PEAR_Remote extends PEAR
$maxAge = '';
};
- if ($proxy_host != '' && $proxy_user != '') {
+ if ($use_proxy && $proxy_host != '' && $proxy_user != '') {
$req_headers .= 'Proxy-Authorization: Basic '
.base64_encode($proxy_user.':'.$proxy_pass)
."\r\n";
@@ -247,7 +249,7 @@ class PEAR_Remote extends PEAR
var_dump($request);
}
- if ($proxy_host != '') {
+ if ($use_proxy && $proxy_host != '') {
$post_string = "POST http://".$server_host;
if ($proxy_port > '') {
$post_string .= ':'.$server_port;