[Mapbender-commits] r1687 - in trunk/mapbender/http: classes extensions javascripts php print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Sep 26 05:38:45 EDT 2007


Author: christoph
Date: 2007-09-26 05:38:45 -0400 (Wed, 26 Sep 2007)
New Revision: 1687

Modified:
   trunk/mapbender/http/classes/class_gml.php
   trunk/mapbender/http/classes/class_wfs.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/extensions/geom2wfst.php
   trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php
   trunk/mapbender/http/php/mod_changeEPSG.php
   trunk/mapbender/http/php/mod_logout.php
   trunk/mapbender/http/php/mod_wfs_result.php
   trunk/mapbender/http/print/mod_printPDF_pdf.php
   trunk/mapbender/http/print/printPDF.conf
   trunk/mapbender/http/print/printPDF_b.conf
Log:
http://trac.osgeo.org/mapbender/ticket/103

Modified: trunk/mapbender/http/classes/class_gml.php
===================================================================
--- trunk/mapbender/http/classes/class_gml.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/classes/class_gml.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -112,7 +112,7 @@
 
 
 	function parseGml($index){
-		$data = preg_replace("&", "&", $this->gml[$index]);
+		$data = preg_replace("/&/", "&", $this->gml[$index]);
 
 		$this->tagList = array_merge($this->multi, $this->pointSingle, $this->lineSingle, $this->polygonSingle);
 		
@@ -200,7 +200,7 @@
 	// and sets the bbox according to these values 
 	// if found it very useful for testing the png output, but now it may be obsolete
 	function parseBbox($gmlIndex, $gml){
-		$data = preg_replace("&", "&", $gml);
+		$data = preg_replace("/&/", "&", $gml);
 
 		$parser = xml_parser_create();
 		xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);

Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/classes/class_wfs.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -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(preg_replace("'","",$this->wfs_name)) ."', ";
-		$sql .= "'" . db_escape_string(preg_replace("'","",$this->wfs_title)) ."', ";
-		$sql .= "'" . db_escape_string(preg_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 . "', ";

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/classes/class_wms.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -752,8 +752,8 @@
 			print("add_wms('". 
 			$this->wms_id ."','".
 			$this->wms_version ."','".
-			preg_replace("'", "", $this->wms_title) ."','".
-			preg_replace("'", "", $this->wms_abstract) ."','". 
+			preg_replace("/'/", "", $this->wms_title) ."','".
+			preg_replace("/'/", "", $this->wms_abstract) ."','". 
 			$this->wms_getmap ."','" .
 			$this->wms_getfeatureinfo ."','".
 			$this->wms_getlegendurl ."','".

Modified: trunk/mapbender/http/extensions/geom2wfst.php
===================================================================
--- trunk/mapbender/http/extensions/geom2wfst.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/extensions/geom2wfst.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -133,7 +133,7 @@
 		$fid = mb_ereg_replace("^.*ogc:FeatureId fid=\"(.+)\"/>.*$", "\\1", $data);
 		echo "\"fid\":\"".$fid."\",";
 	}
-	echo "\"success confirmation\":\"".preg_replace("\"", "'", preg_replace("\n", "", preg_replace("\r", "", $data)))."\",";
+	echo "\"success confirmation\":\"".preg_replace("/\"/", "'", preg_replace("/\n/", "", preg_replace("/\r/", "", $data)))."\",";
 }
 else {
 	$response = "error";

Modified: trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/javascripts/mod_insertKmlIntoDb.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -79,7 +79,7 @@
 	$kml->createKMLFromObj();
 	
 	$sql = "INSERT INTO mb_meetingpoint VALUES ($1, $2, $3, $4, $5, $6)";
-	$v = array($kml->kml_id, $wmc_id, preg_replace("&", "&" , html_entity_decode($kml->kml)), $_SESSION["mb_user_id"], $_SESSION["mb_user_password"], $gui_id);
+	$v = array($kml->kml_id, $wmc_id, preg_replace("/&/", "&" , html_entity_decode($kml->kml)), $_SESSION["mb_user_id"], $_SESSION["mb_user_password"], $gui_id);
 	$t = array('s', 's', 's', 'i', 's', 's');
 	$res = db_prep_query($sql, $v, $t);
 	
@@ -93,7 +93,7 @@
 	}
 	$filename = "../tmp/".$kml->kml_id.'.kml';
 	$handle = fopen($filename, "w");
-	fputs($handle, preg_replace("&", "&" , html_entity_decode($kml->kml)));
+	fputs($handle, preg_replace("/&/", "&" , html_entity_decode($kml->kml)));
 	fclose($handle);
 	
 	echo "Please feel free to add the <a href = 'http://".$_SERVER['HTTP_HOST']."/mburl/".$kml->kml_id."'>link</a> to your meeting point to your website.<br><br>";

Modified: trunk/mapbender/http/php/mod_changeEPSG.php
===================================================================
--- trunk/mapbender/http/php/mod_changeEPSG.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/php/mod_changeEPSG.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -80,19 +80,19 @@
 			$con_string = "host=$GEOS_DBSERVER port=$GEOS_PORT dbname=$GEOS_DB user=$GEOS_OWNER password=$GEOS_PW";
 			$con = pg_connect($con_string) or die ("Error while connecting database");
 			
-			$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+			$sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("/EPSG:/","",$temp[1])."),".preg_replace("/EPSG:/","",$_REQUEST["newSRS"]).")) as minx";
 			$resMinx = pg_query($con,$sqlMinx);
 			$minx = pg_fetch_result($resMinx,0,"minx");
 			
-			$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+			$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".preg_replace("/EPSG:/","",$temp[1])."),".preg_replace("/EPSG:/","",$_REQUEST["newSRS"]).")) as miny";
 			$resMiny = pg_query($con,$sqlMiny);
 			$miny = pg_fetch_result($resMiny,0,"miny");
 			
-			$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+			$sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("/EPSG:/","",$temp[1])."),".preg_replace("/EPSG:/","",$_REQUEST["newSRS"]).")) as maxx";
 			$resMaxx = pg_query($con,$sqlMaxx);
 			$maxx = pg_fetch_result($resMaxx,0,"maxx");
 			
-			$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("EPSG:","",$temp[1])."),".preg_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+			$sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".preg_replace("/EPSG:/","",$temp[1])."),".preg_replace("/EPSG:/","",$_REQUEST["newSRS"]).")) as maxy";
 			$resMaxy = pg_query($con,$sqlMaxy);
 			$maxy = pg_fetch_result($resMaxy,0,"maxy");
 		}

Modified: trunk/mapbender/http/php/mod_logout.php
===================================================================
--- trunk/mapbender/http/php/mod_logout.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/php/mod_logout.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -42,7 +42,7 @@
       header("Location: http://".$_SERVER['HTTP_HOST'].$dir."/login.php");      
    }
    else{
-      header("Location: http://".$_SERVER['HTTP_HOST'].preg_replace("/php","/frames",$dir)."/login.php");
+      header("Location: http://".$_SERVER['HTTP_HOST'].preg_replace("/\/php/","/frames",$dir)."/login.php");
    }
 }
 ?>
\ No newline at end of file

Modified: trunk/mapbender/http/php/mod_wfs_result.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_result.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/php/mod_wfs_result.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -153,7 +153,7 @@
 		$element_str .= "geom.get(" . $member . ").wfs_conf = ".$js_wfs_conf_id.";\n";
 	}
 	else if(mb_strtoupper($element[tag]) == mb_strtoupper("gml:coordinates") && $geom == true){
-		$tmp =  preg_replace(",,","",preg_replace(" ",",",trim($element[value])));
+		$tmp =  preg_replace("/,,/","",preg_replace("/ /",",",trim($element[value])));
 		$geom_str .= "var tmp1 = '".$tmp."';\n";
 		$geom_str .= "var tmp = tmp1.split(',');\n";
 		$geom_str .= "for (var i = 0 ; i < tmp.length ; i+=2) {\n";

Modified: trunk/mapbender/http/print/mod_printPDF_pdf.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF_pdf.php	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php	2007-09-26 09:38:45 UTC (rev 1687)
@@ -149,7 +149,7 @@
 		$m->set('width',(intval($m->get('width'))*4));
 		$m->set('height',(intval($m->get('height'))*4));
 		if(in_array($m->get('map'),$highqualitymapfiles)){	
-			$m->set('map',preg_replace(".map","_4.map",$m->get('map')));			
+			$m->set('map',preg_replace("/\.map/","_4.map",$m->get('map')));			
 		}
 		$array_urls[$i] = $m->url;
 	}
@@ -165,7 +165,7 @@
 	$o_url->set('width',(intval($o_url->get('width'))*4));
 	$o_url->set('height',(intval($o_url->get('height'))*4));
 	if(in_array($o_url->get('map'),$highqualitymapfiles)){	
-			$o_url->set('map',preg_replace(".map","_4.map",$o_url->get('map')));		
+			$o_url->set('map',preg_replace("/\.map/","_4.map",$o_url->get('map')));		
 			$overview_url = $o_url->url;	
 	}
 }
@@ -519,7 +519,7 @@
 
 if ($overview==true){
 	// analyse request, draw rectancle
-	$filename = preg_replace("map_","overview_",$filename);
+	$filename = preg_replace("/map_/","overview_",$filename);
 	if($size == "A4" && $format == "portrait"){
 		$i = new weldOverview2PNG($overview_url,$array_urls[0] ,$filename);
 

Modified: trunk/mapbender/http/print/printPDF.conf
===================================================================
--- trunk/mapbender/http/print/printPDF.conf	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/print/printPDF.conf	2007-09-26 09:38:45 UTC (rev 1687)
@@ -98,7 +98,7 @@
 * url string matching and replacement
 */
 $matching = false;
-$pattern =  "192.168.2.113";
+$pattern =  "/192\.168\.2\.113/";
 $replacement = "192.168.2.5";
 
 /*

Modified: trunk/mapbender/http/print/printPDF_b.conf
===================================================================
--- trunk/mapbender/http/print/printPDF_b.conf	2007-09-26 09:05:01 UTC (rev 1686)
+++ trunk/mapbender/http/print/printPDF_b.conf	2007-09-26 09:38:45 UTC (rev 1687)
@@ -98,7 +98,7 @@
 * url string matching and replacement
 */
 $matching = false;
-$pattern =  "192.168.2.113";
+$pattern =  "/192\.168\.2\.113/";
 $replacement = "192.168.2.5";
 
 /*



More information about the Mapbender_commits mailing list