[Mapbender-commits] r5361 - trunk/mapbender/http/extensions

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 20 05:08:18 EST 2010


Author: christoph
Date: 2010-01-20 05:08:15 -0500 (Wed, 20 Jan 2010)
New Revision: 5361

Modified:
   trunk/mapbender/http/extensions/jqjson.js
Log:
linted and set safe parsing to true

Modified: trunk/mapbender/http/extensions/jqjson.js
===================================================================
--- trunk/mapbender/http/extensions/jqjson.js	2010-01-20 09:53:09 UTC (rev 5360)
+++ trunk/mapbender/http/extensions/jqjson.js	2010-01-20 10:08:15 UTC (rev 5361)
@@ -80,17 +80,22 @@
         };
 
 	$.toJSON = function(v) {
-		var f = isNaN(v) ? s[typeof v] : s['number'];
-		if (f) return f(v);
+		var f = isNaN(v) ? s[typeof v] : s.number;
+		if (f) {
+			return f(v);
+		}
 	};
 	
 	$.parseJSON = function(v, safe) {
-		if (safe === undefined) safe = $.parseJSON.safe;
-		if (safe && !/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v))
+		if (safe === undefined) {
+			safe = $.parseJSON.safe;
+		}
+		if (safe && !(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v))) {
 			return undefined;
-		return eval('('+v+')');
+		}
+		return eval('(' + v + ')');
 	};
 	
-	$.parseJSON.safe = false;
+	$.parseJSON.safe = true;
 
 })(jQuery);



More information about the Mapbender_commits mailing list