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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 6 03:56:50 EDT 2007


Author: christoph
Date: 2007-08-06 03:56:50 -0400 (Mon, 06 Aug 2007)
New Revision: 1585

Modified:
   trunk/mapbender/http/classes/class_wfs.php
Log:
replaced old string functions by multibyte string function

Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php	2007-08-06 07:56:11 UTC (rev 1584)
+++ trunk/mapbender/http/classes/class_wfs.php	2007-08-06 07:56:50 UTC (rev 1585)
@@ -72,16 +72,16 @@
 	
 	foreach ($values as $element) {
 	
-		if(strtoupper($element[tag]) == "WFS_CAPABILITIES" && $element[type] == "open"){
+		if(mb_strtoupper($element[tag]) == "WFS_CAPABILITIES" && $element[type] == "open"){
 			$this->wfs_version = $element[attributes][version];
 		}
-		if(strtoupper($element[tag]) == "NAME"  && $element[level] == '3'){
+		if(mb_strtoupper($element[tag]) == "NAME"  && $element[level] == '3'){
 			$this->wfs_name = $element[value];
 		}
-		if(strtoupper($element[tag]) == "TITLE"  && $element[level] == '3'){
+		if(mb_strtoupper($element[tag]) == "TITLE"  && $element[level] == '3'){
 			$this->wfs_title = $element[value];
 		}
-		if(strtoupper($element[tag]) == "ABSTRACT" && $element[level] == '3'){
+		if(mb_strtoupper($element[tag]) == "ABSTRACT" && $element[level] == '3'){
 			$this->wfs_abstract = $element[value];
 		}
 		
@@ -91,55 +91,55 @@
 		if($this->wfs_version == "1.0.0"){
 			
 			# getCapabilities
-			if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
 				$section = "getcapabilities";
 			}
-			if($section == "getcapabilities" && strtoupper($element[tag]) == "GET"){
+			if($section == "getcapabilities" && mb_strtoupper($element[tag]) == "GET"){
 				$this->wfs_getcapabilities = $element[attributes][onlineResource];
 			}
 			
 			# descriptFeatureType
-			if(strtoupper($element[tag]) == "DESCRIBEFEATURETYPE" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "DESCRIBEFEATURETYPE" && $element[type] == "open"){
 				$section = "describefeaturetype";
 				$this->wfs_describefeaturetype = $element[attributes][onlineResource];
 				
 				
 			}
-			if($section == "describefeaturetype" && strtoupper($element[tag]) == "GET"){
+			if($section == "describefeaturetype" && mb_strtoupper($element[tag]) == "GET"){
 				$this->wfs_describefeaturetype = $element[attributes][onlineResource];
 			}
 			
 			# getFeature
-			if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
 				$section = "getfeature";
 			}
-			if($section == "getfeature" && strtoupper($element[tag]) == "GET"){
+			if($section == "getfeature" && mb_strtoupper($element[tag]) == "GET"){
 				$this->wfs_getfeature = $element[attributes][onlineResource];
 			}
-			if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
+			if(mb_strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
 				$section = "";
 			}			
 			# transaction
-			if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
 				$section = "transaction";
 			}
-			if($section == "transaction" && strtoupper($element[tag]) == "GET"){
+			if($section == "transaction" && mb_strtoupper($element[tag]) == "GET"){
 				$this->wfs_transaction = $element[attributes][onlineResource];
 			}
-			if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
+			if(mb_strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
 				$section = "";
 			}
 		} 
-		if(strtoupper($element[tag]) == "FEATURETYPE" && $element[type] == "open"){
+		if(mb_strtoupper($element[tag]) == "FEATURETYPE" && $element[type] == "open"){
 			$section = "featuretype";
 		}
-		if($section == "featuretype" && strtoupper($element[tag]) == "NAME"){
+		if($section == "featuretype" && mb_strtoupper($element[tag]) == "NAME"){
 			$featuretype_name = $element[value];
 		}
-		if($section == "featuretype" && strtoupper($element[tag]) == "TITLE"){
+		if($section == "featuretype" && mb_strtoupper($element[tag]) == "TITLE"){
 			$featuretype_title = $element[value];
 		}
-		if($section == "featuretype" && strtoupper($element[tag]) == "SRS"){
+		if($section == "featuretype" && mb_strtoupper($element[tag]) == "SRS"){
 			$featuretype_srs = $element[value];
 			$this->addFeaturetype($featuretype_name,$featuretype_title,$featuretype_srs,$this->wfs_describefeaturetype,$this->wfs_version);
 		}
@@ -226,9 +226,9 @@
 	$sql = "INSERT INTO wfs (wfs_version, wfs_name, wfs_title, wfs_abstract, wfs_getcapabilities, wfs_describefeaturetype, wfs_getfeature, wfs_transaction) ";
 	$sql .= "VALUES(";
 		$sql .= "'" . $this->wfs_version ."', ";
-		$sql .= "'" . db_escape_string(str_replace("'","",$this->wfs_name)) ."', ";
-		$sql .= "'" . db_escape_string(str_replace("'","",$this->wfs_title)) ."', ";
-		$sql .= "'" . db_escape_string(str_replace("'","",$this->wfs_abstract)) .  "', ";
+		$sql .= "'" . db_escape_string(preg_replace("'","",$this->wfs_name)) ."', ";
+		$sql .= "'" . db_escape_string(preg_replace("'","",$this->wfs_title)) ."', ";
+		$sql .= "'" . db_escape_string(preg_replace("'","",$this->wfs_abstract)) .  "', ";
 		$sql .= "'" . $this->wfs_getcapabilities ."', ";
 		$sql .= "'" . $this->wfs_describefeaturetype . "', ";
 		$sql .= "'". $this->wfs_getfeature . "', ";
@@ -390,7 +390,7 @@
 			
 			if($section == "namespace"){		
 				while (list($k, $val) = each ($element[attributes])) {
-   					if (substr($k, 0, 5) == "xmlns") {
+   					if (mb_substr($k, 0, 5) == "xmlns") {
 						$cnt = count($this->featuretype_namespace);
 						$match = false;
 						for ($i = 0 ; $i < $cnt && $match == false ; $i++) {
@@ -431,9 +431,9 @@
 		}
 	}
 	function sepNameSpace($s){
-		$c = strpos($s,":"); 
+		$c = mb_strpos($s,":"); 
 		if($c>0){
-			return substr($s,$c+1);
+			return mb_substr($s,$c+1);
 		}
 		else{
 			return $s;



More information about the Mapbender_commits mailing list