[Mapbender-commits] r3850 - trunk/mapbender/http/include

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Apr 3 05:02:13 EDT 2009


Author: christoph
Date: 2009-04-03 05:02:12 -0400 (Fri, 03 Apr 2009)
New Revision: 3850

Modified:
   trunk/mapbender/http/include/dyn_css.php
   trunk/mapbender/http/include/dyn_js.php
Log:
http://trac.osgeo.org/mapbender/ticket/426

Modified: trunk/mapbender/http/include/dyn_css.php
===================================================================
--- trunk/mapbender/http/include/dyn_css.php	2009-04-03 08:58:47 UTC (rev 3849)
+++ trunk/mapbender/http/include/dyn_css.php	2009-04-03 09:02:12 UTC (rev 3850)
@@ -121,7 +121,15 @@
 		else {
 			echo "var ";
 		}
-		echo $row["var_name"]." = '".stripslashes($row["var_value"])."';\n";
+		if (is_numeric(stripslashes($row["var_value"]))) {
+			echo $row["var_name"]." = ".stripslashes($row["var_value"]).";\n";
+		}
+		elseif (strpos(stripslashes($row["var_value"]), "[") === 0 || strpos(stripslashes($row["var_value"]), "{") === 0) {
+			echo $row["var_name"]." = ".stripslashes($row["var_value"]).";\n";
+		}
+		else {
+			echo $row["var_name"]." = '".str_replace(array('"',"'", "\r", "\n", "\0"), array('\"','\\\'','\r', '\n', '\0'), stripslashes($row["var_value"]))."';\n";
+		}
 	}
 	echo "// -->\n";
 	echo "</script>\n";

Modified: trunk/mapbender/http/include/dyn_js.php
===================================================================
--- trunk/mapbender/http/include/dyn_js.php	2009-04-03 08:58:47 UTC (rev 3849)
+++ trunk/mapbender/http/include/dyn_js.php	2009-04-03 09:02:12 UTC (rev 3850)
@@ -44,6 +44,9 @@
 		if (is_numeric(stripslashes($row["var_value"]))) {
 			echo $row["var_name"]." = ".stripslashes($row["var_value"]).";\n";
 		}
+		elseif (strpos(stripslashes($row["var_value"]), "[") === 0 || strpos(stripslashes($row["var_value"]), "{") === 0) {
+			echo $row["var_name"]." = ".stripslashes($row["var_value"]).";\n";
+		}
 		else {
 			echo $row["var_name"]." = '".str_replace(array('"',"'", "\r", "\n", "\0"), array('\"','\\\'','\r', '\n', '\0'), stripslashes($row["var_value"]))."';\n";
 		}



More information about the Mapbender_commits mailing list