[Mapbender-commits] r5013 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Nov 19 05:46:27 EST 2009


Author: armin11
Date: 2009-11-19 05:46:26 -0500 (Thu, 19 Nov 2009)
New Revision: 5013

Modified:
   trunk/mapbender/http/classes/class_connector.php
Log:
remove buggy proxy handling 2

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2009-11-19 10:37:12 UTC (rev 5012)
+++ trunk/mapbender/http/classes/class_connector.php	2009-11-19 10:46:26 UTC (rev 5013)
@@ -64,27 +64,15 @@
 		}
 		switch ($this->connectionType) {
 			case "curl":
-		        //$host = parse_url($url,PHP_URL_HOST);
-		        
-		        // fill array (HOSTs not for Proxy)
-		        //$NOT_PROXY_HOSTS_array = explode(",", NOT_PROXY_HOSTS);
-
-				if (in_array($host, $NOT_PROXY_HOSTS_array)){
-				//    $e = new mb_notice("HTTP host:".$host);
-				//	$this->file = $this->getHTTP($url);
-				}
-				else {
-				    $e = new mb_notice("CURL host:".$host);
-					if (func_num_args() == 2) {
+			    if (func_num_args() == 2) {
             			$auth = func_get_arg(1);
 						if (isset($auth)) {
 							$this->file = $this->getCURL($url,$auth);
 						}
-					}
-					else {
-						$this->file = $this->getCURL($url);
-					}
 				}
+				else {
+					$this->file = $this->getCURL($url);
+				}
 				break;
 			case "http":
 				$this->file = $this->getHTTP($url);
@@ -182,7 +170,11 @@
 		//allow https connections and handle certificates quite simply ;-)
 		curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
 		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
-		if(CONNECTION_PROXY != ""){
+		//get hostname/ip out of url
+		$host = parse_url($url,PHP_URL_HOST);
+		// fill array (HOSTs not for Proxy)
+ 	    $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);	
 		}		
 		if(CONNECTION_PASSWORD != ""){



More information about the Mapbender_commits mailing list