svn commit: r694 - trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php

christoph at osgeo.org christoph at osgeo.org
Tue Jul 25 08:33:00 EDT 2006


Author: christoph
Date: 2006-07-25 12:33:00+0000
New Revision: 694

Modified:
   trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php

Log:
fixed character coding


Modified: trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php?view=diff&rev=694&p1=trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php&p2=trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php&r1=693&r2=694
==============================================================================
--- trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php	(original)
+++ trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php	2006-07-25 12:33:00+0000
@@ -53,8 +53,9 @@
 	$d = explode("____", $_POST["data"]);	
 	// Display WMC 
 	//echo "<pre>" . stripslashes($d[2]) . "</pre>";
+	$alert = $d[4];
 	
-	$sql = "INSERT INTO mb_user_wmc VALUES ('" . $d[3] . "', '" . $d[0] . "', '" . char_encode(str_replace("&", "&#38;" , html_entity_decode($d[2]))) . "', '" . $d[1] . "', '" . time() . "')";
+	$sql = "INSERT INTO mb_user_wmc VALUES ('" . $d[3] . "', '" . $d[0] . "', '" . str_replace("&", "&#38;" , html_entity_decode($d[2])) . "', '" . $d[1] . "', '" . time() . "')";
 	
 	
 	$res = db_query($sql);
@@ -65,13 +66,9 @@
 			 echo "<script>var title = \"" . $wmc_title . "\";alert(\"Error while saving WMC document \" + title + \"!\");</script>";
 	}
 	else {
+		if ($alert) {
 			 echo "<script>var title = \"" . $wmc_title . "\";alert(\"WMC document \" + title + \"has been saved!\")</script>";
-	}
-}
-function char_encode($s){
-		if(CHARSET == 'UTF-8'){
-			$s = utf8_encode($s);	
 		}
-		return $s;
+	}
 }
 ?>
\ No newline at end of file




More information about the Mapbender_commits mailing list