[Mapbender-commits] r6414 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Jun 23 07:46:34 EDT 2010
Author: verenadiewald
Date: 2010-06-23 11:46:34 +0000 (Wed, 23 Jun 2010)
New Revision: 6414
Modified:
trunk/mapbender/http/classes/class_connector.php
Log:
ignore env http_proxy for curl connection
Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php 2010-06-23 10:48:55 UTC (rev 6413)
+++ trunk/mapbender/http/classes/class_connector.php 2010-06-23 11:46:34 UTC (rev 6414)
@@ -188,8 +188,13 @@
// fill array (HOSTs not for Proxy)
$e = new mb_notice("connector: NOT_PROXY_HOSTS:".NOT_PROXY_HOSTS);
$NOT_PROXY_HOSTS_array = explode(",", NOT_PROXY_HOSTS);
- if(CONNECTION_PROXY != "" AND (in_array($host, $NOT_PROXY_HOSTS_array)!= true)){
- curl_setopt($ch, CURLOPT_PROXY,CONNECTION_PROXY.":".CONNECTION_PORT);
+
+ //check if http_proxy is set as env, if yes, unset it for the curl action here, it will be reset somewhere below
+ $tmpHttpProxy = getenv('http_proxy')?getenv('http_proxy') : "";
+ putenv("http_proxy");
+
+ if(CONNECTION_PROXY != "" AND (in_array($host, $NOT_PROXY_HOSTS_array)!= true)){
+ curl_setopt($ch, CURLOPT_PROXY,CONNECTION_PROXY.":".CONNECTION_PORT);
}
if(CONNECTION_PASSWORD != ""){
curl_setopt ($ch, CURLOPT_PROXYUSERPWD, CONNECTION_USER.':'.CONNECTION_PASSWORD);
@@ -238,6 +243,9 @@
}
curl_close ($ch);
+ //reset the env variable http_proxy to the former value
+ putenv("http_proxy=$tmpHttpProxy");
+
return $file;
}
More information about the Mapbender_commits
mailing list