Skip to content

Commit

Permalink
Revert "JSON now throws an error if security is enabled and a string …
Browse files Browse the repository at this point in the history
…fails decoding due to security." New feature, must wait until 2.0.

This reverts commit 1a0d5b5.
  • Loading branch information
appden committed Sep 9, 2009
1 parent db5a5af commit 5a24e2f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Source/Utilities/JSON.js
Expand Up @@ -38,8 +38,7 @@ var JSON = new Hash({

decode: function(string, secure){
if ($type(string) != 'string' || !string.length) return null;
if (secure && !(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '')))
throw new Error('JSON could not decode the input; security is enabled and the value is not secure.');
if (secure && !(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''))) return null;
return eval('(' + string + ')');
}

Expand Down

0 comments on commit 5a24e2f

Please sign in to comment.