Permalink
Browse files

fix problem proxy settings are not reflected

  • Loading branch information...
maruTA-bis5 committed Nov 13, 2013
1 parent 2fabcaa commit 9970385a50b0060b27077b43e60f9c875c65a5cf
Showing with 3 additions and 15 deletions.
  1. +3 −15 XML/RPC2/Util/HTTPRequest.php
@@ -169,19 +169,7 @@ public function __construct($uri = '', $params = array())
$this->_encoding = $params['encoding'];
}
if (isset($params['proxy'])) {
$proxy = $params['proxy'];
$elements = parse_url($proxy);
if (is_array($elements)) {
if ((isset($elements['scheme'])) and (isset($elements['host']))) {
$this->_proxy = $elements['scheme'] . '://' . $elements['host'];
}
if (isset($elements['port'])) {
$this->_proxy = $this->_proxy . ':' . $elements['port'];
}
if ((isset($elements['user'])) and (isset($elements['pass']))) {
$this->_proxyAuth = $elements['user'] . ':' . $elements['pass'];
}
}
$this->_proxy = $params['proxy'];
}
if (isset($params['sslverify'])) {
$this->_sslverify = $params['sslverify'];
@@ -209,8 +197,8 @@ public function sendRequest()
$request = $this->_httpRequest;
$request->setUrl($this->_uri);
$request->setMethod(HTTP_Request2::METHOD_POST);
if (isset($params['proxy'])) {
$elements = parse_url($params['proxy']);
if (isset($this->_proxy)) {
$elements = parse_url($this->_proxy);
if (is_array($elements)) {
if ((isset($elements['scheme'])) and (isset($elements['host']))) {
$request->setConfig('proxy_host', $elements['host']);

0 comments on commit 9970385

Please sign in to comment.