[Mapbender-commits] r5273 - branches/2.6/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 5 10:45:16 EST 2010


Author: christoph
Date: 2010-01-05 10:45:16 -0500 (Tue, 05 Jan 2010)
New Revision: 5273

Modified:
   branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
Log:
http://trac.osgeo.org/mapbender/ticket/581

Modified: branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2010-01-05 15:43:24 UTC (rev 5272)
+++ branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2010-01-05 15:45:16 UTC (rev 5273)
@@ -1026,8 +1026,19 @@
 							}
 						}
 					}
-					var geoObj = eval('(' + jsCode + ')');
-		       		if (jsCode) {
+					try {
+						var geoObj = parent.$.parseJSON(jsCode);
+					}
+					catch (exc) {
+						document.getElementById("res").innerHTML = '';
+						alert("Invalid data returned from service.");
+						return false;
+					}
+		       		if (typeof geoObj === "undefined") {
+						document.getElementById("res").innerHTML = '';
+						alert("Invalid data returned from service.");
+					}
+					else if (jsCode) {
 			        	if (typeof(geoObj) == 'object') {
 			        		geomArray.importGeoJSON(geoObj);
 			        		document.getElementById("res").innerHTML = '';



More information about the Mapbender_commits mailing list