Skip to content

Commit

Permalink
Back out the try/catch logic from around JSON.parse. We should always…
Browse files Browse the repository at this point in the history
… try to use it, otherwise security will suffer.
  • Loading branch information
jeresig committed Jan 7, 2010
1 parent c68fbc2 commit c14fa51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ajax.js
Expand Up @@ -578,10 +578,10 @@ jQuery.extend({
// Get the JavaScript object, if JSON is used.
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
// Try to use the native JSON parser first
try {
data = JSON.parse( data );
if ( window.JSON && window.JSON.parse ) {
data = window.JSON.parse( data );

} catch(e) {
} else {
data = (new Function("return " + data))();
}
}
Expand Down

0 comments on commit c14fa51

Please sign in to comment.