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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 6 03:57:38 EDT 2007


Author: christoph
Date: 2007-08-06 03:57:38 -0400 (Mon, 06 Aug 2007)
New Revision: 1586

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

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2007-08-06 07:56:50 UTC (rev 1585)
+++ trunk/mapbender/http/classes/class_wmc.php	2007-08-06 07:57:38 UTC (rev 1586)
@@ -23,8 +23,8 @@
 require_once("../classes/class_administration.php");
 
 function sepNameSpace($s){
-	$c = strpos($s,":"); 
-	if($c>0)return substr($s,$c+1);
+	$c = mb_strpos($s,":"); 
+	if($c>0)return mb_substr($s,$c+1);
 	return $s;
 }
 class wmc {
@@ -156,145 +156,145 @@
 		$stylelist = false;
 		
 		foreach ($values as $element) {
-			if(strtoupper($element[tag]) == "VIEWCONTEXT" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "VIEWCONTEXT" && $element[type] == "open"){
 					$this->wmc_id = $element[attributes]["id"];
 					$this->wmc_version = $element[attributes]["version"];
 			}
-			if(strtoupper($element[tag]) == "GENERAL" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "GENERAL" && $element[type] == "open"){
 			   $general = true;
 			}
-			if(strtoupper($element[tag]) == "LAYERLIST" && $element[type] == "open"){
+			if(mb_strtoupper($element[tag]) == "LAYERLIST" && $element[type] == "open"){
 			   $layerlist = true;
 			}
 			if ($general) {
-				if(strtoupper($element[tag]) == "WINDOW"){
+				if(mb_strtoupper($element[tag]) == "WINDOW"){
 					$this->wmc_windowWidth = $element[attributes]["width"];
 					$this->wmc_windowHeight = $element[attributes]["height"];
 				}
-				if(strtoupper($element[tag]) == "BOUNDINGBOX"){
+				if(mb_strtoupper($element[tag]) == "BOUNDINGBOX"){
 					$this->wmc_bBox_SRS = $element[attributes]["SRS"];
 					$this->wmc_bBox_minx = $element[attributes]["minx"];
 					$this->wmc_bBox_miny = $element[attributes]["miny"];
 					$this->wmc_bBox_maxx = $element[attributes]["maxx"];
 					$this->wmc_bBox_maxy = $element[attributes]["maxy"];
 				}
-				if(strtoupper($element[tag]) == "NAME"){
+				if(mb_strtoupper($element[tag]) == "NAME"){
 					$this->wmc_name = $element[value];
 				}
-				if(strtoupper($element[tag]) == "TITLE"){
+				if(mb_strtoupper($element[tag]) == "TITLE"){
 					$this->wmc_title = $element[value];
 				}
-				if(strtoupper($element[tag]) == "ABSTRACT"){
+				if(mb_strtoupper($element[tag]) == "ABSTRACT"){
 					$this->wmc_abstract = $element[value];
 				}
-				if(strtoupper($element[tag]) == "CONTACTINFORMATION" && $element['type'] == "open"){
+				if(mb_strtoupper($element[tag]) == "CONTACTINFORMATION" && $element['type'] == "open"){
 					$contactinformation = true;
 				}
 				if ($contactinformation) {
-					if(strtoupper($element[tag]) == "CONTACTPOSITION"){
+					if(mb_strtoupper($element[tag]) == "CONTACTPOSITION"){
 						$this->wmc_contactposition = $element[value];
 					}
-					if(strtoupper($element[tag]) == "CONTACTVOICETELEPHONE"){
+					if(mb_strtoupper($element[tag]) == "CONTACTVOICETELEPHONE"){
 						$this->wmc_contactvoicetelephone = $element[value];
 					}
-					if(strtoupper($element[tag]) == "CONTACTFACSIMILETELEPHONE"){
+					if(mb_strtoupper($element[tag]) == "CONTACTFACSIMILETELEPHONE"){
 						$this->wmc_contactfacsimiletelephone = $element[value];
 					}
-					if(strtoupper($element[tag]) == "CONTACTELECTRONICMAILADDRESS"){
+					if(mb_strtoupper($element[tag]) == "CONTACTELECTRONICMAILADDRESS"){
 						$this->wmc_contactemail = $element[value];
 					}
-					if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "open"){
+					if(mb_strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "open"){
 						$contactpersonprimary = true;
 					}
 					if ($contactpersonprimary) {
-						if(strtoupper($element[tag]) == "CONTACTPERSON"){
+						if(mb_strtoupper($element[tag]) == "CONTACTPERSON"){
 							$this->wmc_contactperson = $element[value];
 						}
-						if(strtoupper($element[tag]) == "CONTACTORGANIZATION"){
+						if(mb_strtoupper($element[tag]) == "CONTACTORGANIZATION"){
 							$this->wmc_contactorganization = $element[value];
 						}
-						if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "close"){
+						if(mb_strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "close"){
 							$contactpersonprimary = false;
 						}
 					}
-					if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "open"){
+					if(mb_strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "open"){
 						$contactaddress = true;
 					}
 					if ($contactaddress) {
-						if(strtoupper($element[tag]) == "ADDRESSTYPE"){
+						if(mb_strtoupper($element[tag]) == "ADDRESSTYPE"){
 							$this->wmc_contactaddresstype = $element[value];
 						}
-						if(strtoupper($element[tag]) == "ADDRESS"){
+						if(mb_strtoupper($element[tag]) == "ADDRESS"){
 							$this->wmc_contactaddress = $element[value];
 						}
-						if(strtoupper($element[tag]) == "CITY"){
+						if(mb_strtoupper($element[tag]) == "CITY"){
 							$this->wmc_contactcity = $element[value];
 						}
-						if(strtoupper($element[tag]) == "STATEORPROVINCE"){
+						if(mb_strtoupper($element[tag]) == "STATEORPROVINCE"){
 							$this->wmc_contactstateorprovince = $element[value];
 						}
-						if(strtoupper($element[tag]) == "POSTCODE"){
+						if(mb_strtoupper($element[tag]) == "POSTCODE"){
 							$this->wmc_contactpostcode = $element[value];
 						}
-						if(strtoupper($element[tag]) == "COUNTRY"){
+						if(mb_strtoupper($element[tag]) == "COUNTRY"){
 							$this->wmc_contactcountry = $element[value];
 						}
-						if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "close"){
+						if(mb_strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "close"){
 							$contactaddress = false;
 						}
 					}
 				}
-				if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "open"){
+				if(mb_strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "open"){
 					$logourl = true;
 					$this->wmc_logourl_width = $element[attributes]["width"];
 					$this->wmc_logourl_height = $element[attributes]["height"];
 					$this->wmc_logourl_format = $element[attributes]["format"];
 				}
 				if ($logourl) {
-					if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "close"){
+					if(mb_strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "close"){
 						$logourl = false;
 					}
-					if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+					if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 						$this->wmc_logourl_type = $element[attributes]["xlink:type"];
 						$this->wmc_logourl = $element[attributes]["xlink:href"];
 					}
 				}
-				if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "open"){
+				if(mb_strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "open"){
 					$descriptionurl = true;
 					$this->wmc_descriptionurl_format = $element[attributes]["format"];
 				}
 				if ($descriptionurl) {
-					if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "close"){
+					if(mb_strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "close"){
 						$descriptionurl = false;
 					}
-					if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+					if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 						$this->wmc_descriptionurl_type = $element[attributes]["xlink:type"];
 						$this->wmc_descriptionurl = $element[attributes]["xlink:href"];
 					}
 				}
-				if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "open"){
+				if(mb_strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "open"){
 					$keywordlist = true;
 				}
 				if ($keywordlist) {
-					if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "close"){
+					if(mb_strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "close"){
 						$keywordlist = false;
 						$cnt_keyword = -1;
 					}
-					if(strtoupper($element[tag]) == "KEYWORD"){
+					if(mb_strtoupper($element[tag]) == "KEYWORD"){
 						$cnt_keyword++;
 						$this->wmc_keyword[$cnt_keyword] = $element[value];
 					}
 				}
 						
-				if(strtoupper($element[tag]) == "GENERAL" && $element['type'] == "close"){
+				if(mb_strtoupper($element[tag]) == "GENERAL" && $element['type'] == "close"){
 		   			$general = false;
 			 	}
 			}
 			if ($layerlist) {
-				if(strtoupper($element[tag]) == "LAYERLIST" && $element['type'] == "close"){
+				if(mb_strtoupper($element[tag]) == "LAYERLIST" && $element['type'] == "close"){
 				   $layerlist = false;
 				}
-				if(strtoupper($element[tag]) == "LAYER" && $element[type] == "open"){
+				if(mb_strtoupper($element[tag]) == "LAYER" && $element[type] == "open"){
 					 $cnt_layer++;
 					 $this->wmc_layer_queryable[$cnt_layer] = $element[attributes]["queryable"];
 					 $this->wmc_layer_hidden[$cnt_layer] = $element[attributes]["hidden"];
@@ -302,113 +302,113 @@
       		 		 $cnt_epsg = 0;
 				}
 				if ($layer) {
-					if(strtoupper($element[tag]) == "LAYER" && $element[type] == "close"){
+					if(mb_strtoupper($element[tag]) == "LAYER" && $element[type] == "close"){
 						$layer = false;
 					}
 					 if ($formatlist) {
-						 if(strtoupper($element[tag]) == "FORMAT"){
+						 if(mb_strtoupper($element[tag]) == "FORMAT"){
 						 	$cnt_format++;
 						 	$this->wmc_layer_format_current[$cnt_layer][$cnt_format] = $element[attributes]["current"];
 						 	$this->wmc_layer_format[$cnt_layer][$cnt_format] = $element[value];
 						 }
-						 if(strtoupper($element[tag]) == "FORMATLIST" && $element[type] == "close"){
+						 if(mb_strtoupper($element[tag]) == "FORMATLIST" && $element[type] == "close"){
 							 $formatlist = false;
 						 }
 					 }
 					 elseif ($metadataurl) {
-						 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						 if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 							$this->wmc_layer_metadataurl[$cnt_layer] = $element[attributes]["xlink:href"];
 						 }
-						 if(strtoupper($element[tag]) == "METADATAURL" && $element[type] == "close"){
+						 if(mb_strtoupper($element[tag]) == "METADATAURL" && $element[type] == "close"){
 							$metadataurl = false;
 						 }
 					 }
 					 elseif ($dataurl) {
-						 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						 if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 						 	$this->wmc_layer_dataurl[$cnt_layer] = $element[attributes]["xlink:href"];
 						 }
-						 if(strtoupper($element[tag]) == "DATAURL" && $element[type] == "close"){
+						 if(mb_strtoupper($element[tag]) == "DATAURL" && $element[type] == "close"){
 							 $dataurl = false;
 						 }
 					 }
 					 elseif ($stylelist) {
-						 if(strtoupper($element[tag]) == "STYLE" && $element[type] == "open"){
+						 if(mb_strtoupper($element[tag]) == "STYLE" && $element[type] == "open"){
 						 	$cnt_style++;
 						 	$style = true;
 						 	$this->wmc_layer_style_current[$cnt_layer][$cnt_style] = $element[attributes]["current"];
 						 }
 						 if ($style) {
-							 if(strtoupper($element[tag]) == "STYLE" && $element[type] == "close"){
+							 if(mb_strtoupper($element[tag]) == "STYLE" && $element[type] == "close"){
 							 	$style = false;
 							 }
-							 if(strtoupper($element[tag]) == "SLD" && $element[type] == "open"){
+							 if(mb_strtoupper($element[tag]) == "SLD" && $element[type] == "open"){
 							 	$sld = true;
 							 }
 							 if ($sld) {
-								 if(strtoupper($element[tag]) == "SLD" && $element[type] == "close"){
+								 if(mb_strtoupper($element[tag]) == "SLD" && $element[type] == "close"){
 								 	$sld = false;
 								 }
-								 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+								 if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 								 	$this->wmc_layer_style_sld_type[$cnt_layer][$cnt_style] = $element[attributes]["xlink:type"];
 								 	$this->wmc_layer_style_sld_url[$cnt_layer][$cnt_style] = $element[attributes]["xlink:href"];
 								 }
-								 if(strtoupper($element[tag]) == "TITLE"){
+								 if(mb_strtoupper($element[tag]) == "TITLE"){
 								 	$this->wmc_layer_style_sld_title[$cnt_layer][$cnt_style] = $element[value];
 								 }
 							 }
 							 else {
-								 if(strtoupper($element[tag]) == "NAME"){
+								 if(mb_strtoupper($element[tag]) == "NAME"){
 								 	$this->wmc_layer_style_name[$cnt_layer][$cnt_style] = $element[value];
 								 }
-								 if(strtoupper($element[tag]) == "TITLE"){
+								 if(mb_strtoupper($element[tag]) == "TITLE"){
 								 	$this->wmc_layer_style_title[$cnt_layer][$cnt_style] = $element[value];
 								 }
-								 if(strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "open"){
+								 if(mb_strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "open"){
 								 	$legendurl = true;
 								 	$this->wmc_layer_style_legendurl_width[$cnt_layer][$cnt_style] = $element[attributes]["width"];
 								 	$this->wmc_layer_style_legendurl_height[$cnt_layer][$cnt_style] = $element[attributes]["height"];
 								 	$this->wmc_layer_style_legendurl_format[$cnt_layer][$cnt_style] = $element[attributes]["format"];
 								 }
 								 if ($legendurl) {
-									 if(strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "close"){
+									 if(mb_strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "close"){
 									 	$legendurl = false;
 									 }
-									 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+									 if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 									 	$this->wmc_layer_style_legendurl_type[$cnt_layer][$cnt_style] = $element[attributes]["xlink:type"];
 									 	$this->wmc_layer_style_legendurl[$cnt_layer][$cnt_style] = $element[attributes]["xlink:href"];
 									 }
 								 }
 							 }
 						 }
-						 if(strtoupper($element[tag]) == "STYLELIST" && $element[type] == "close"){
+						 if(mb_strtoupper($element[tag]) == "STYLELIST" && $element[type] == "close"){
 							 $stylelist = false;
 						 }
 					 }
 					 else {
-						 if(strtoupper($element[tag]) == "SERVER" && $element[type] == "open"){
+						 if(mb_strtoupper($element[tag]) == "SERVER" && $element[type] == "open"){
 						 	 $server = true;
 						 	 $this->wmc_wms_service[$cnt_layer] = $element[attributes]["service"];
 						 	 $this->wmc_wms_version[$cnt_layer] = $element[attributes]["version"];
 						 	 $this->wmc_wms_title[$cnt_layer] = $element[attributes]["title"];
 						 }
 						 if ($server) {
-							 if(strtoupper($element[tag]) == "SERVER" && $element[type] == "close"){
+							 if(mb_strtoupper($element[tag]) == "SERVER" && $element[type] == "close"){
 							 	 $server = false;
 							 }
-							 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+							 if(mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
 						 		 $this->wmc_wms_serviceURL[$cnt_layer] = $element[attributes]["xlink:href"];
 							 }
 						 }
-						 if(strtoupper($element[tag]) == "NAME"){
+						 if(mb_strtoupper($element[tag]) == "NAME"){
 					 		 $this->wmc_layer_name[$cnt_layer] = $element[value];
 						 }
-						 if(strtoupper($element[tag]) == "TITLE"){
+						 if(mb_strtoupper($element[tag]) == "TITLE"){
 					 		 $this->wmc_layer_title[$cnt_layer] = $element[value];
 						 }
-						 if(strtoupper($element[tag]) == "ABSTRACT"){
+						 if(mb_strtoupper($element[tag]) == "ABSTRACT"){
 					 		 $this->wmc_layer_abstract[$cnt_layer] = $element[value];
 						 }
-						 if(strtoupper($element[tag]) == "SRS"){
+						 if(mb_strtoupper($element[tag]) == "SRS"){
 							 $epsgArray = explode(" ", $element[value]);						 	
 					 		 
 					 		 for ($c = 0 ; $c < count($epsgArray) ; $c ++) {
@@ -416,36 +416,36 @@
 								 $cnt_epsg++;
 					 		 }
 						 }
-						 if (strtoupper($element[tag]) == "EXTENSION" && $element[type] == "open") {
+						 if (mb_strtoupper($element[tag]) == "EXTENSION" && $element[type] == "open") {
 						 	$extension = true;
 						 }
-						 if (strtoupper($element[tag]) == "EXTENSION" && $element[type] == "close") {
+						 if (mb_strtoupper($element[tag]) == "EXTENSION" && $element[type] == "close") {
 						 	$extension = false;
 						 }
-						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "SCALEHINT"){
+						 if($extension == true && mb_strtoupper(sepNameSpace($element[tag])) == "SCALEHINT"){
 					 		 $this->wmc_layer_minscale[$cnt_layer] = $element[attributes]["min"];
 					 		 $this->wmc_layer_maxscale[$cnt_layer] = $element[attributes]["max"];
 						 }
-						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "LAYER_ID"){
+						 if($extension == true && mb_strtoupper(sepNameSpace($element[tag])) == "LAYER_ID"){
 					 		 $this->wmc_layer_id[$cnt_layer] = $element[value];
 						 }
-						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "WMS_ID"){
+						 if($extension == true && mb_strtoupper(sepNameSpace($element[tag])) == "WMS_ID"){
 					 		 $this->wmc_wms_id[$cnt_layer] = $element[value];
 						 }
-						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "QUERYLAYER"){
+						 if($extension == true && mb_strtoupper(sepNameSpace($element[tag])) == "QUERYLAYER"){
 					 		 $this->wmc_layer_querylayer[$cnt_layer] = $element[value];
 						 }
-						 if(strtoupper(sepNameSpace($element[tag])) == "METADATAURL" && $element[type] == "open"){
+						 if(mb_strtoupper(sepNameSpace($element[tag])) == "METADATAURL" && $element[type] == "open"){
 							 $metadataurl = true;
 						 }
-						 if(strtoupper(sepNameSpace($element[tag])) == "DATAURL" && $element[type] == "open"){
+						 if(mb_strtoupper(sepNameSpace($element[tag])) == "DATAURL" && $element[type] == "open"){
 							 $dataurl = true;
 						 }
-						 if(strtoupper(sepNameSpace($element[tag])) == "FORMATLIST" && $element[type] == "open"){
+						 if(mb_strtoupper(sepNameSpace($element[tag])) == "FORMATLIST" && $element[type] == "open"){
 							 $formatlist = true;
 							 $cnt_format = -1;
 						 }
-						 if(strtoupper(sepNameSpace($element[tag])) == "STYLELIST" && $element[type] == "open"){
+						 if(mb_strtoupper(sepNameSpace($element[tag])) == "STYLELIST" && $element[type] == "open"){
 							 $stylelist = true;
 							 $cnt_style = -1;
 						 }



More information about the Mapbender_commits mailing list