Commit c14fa516 authored by jeresig's avatar jeresig

Back out the try/catch logic from around JSON.parse. We should always try to...

Back out the try/catch logic from around JSON.parse. We should always try to use it, otherwise security will suffer.
parent c68fbc20
...@@ -578,10 +578,10 @@ jQuery.extend({ ...@@ -578,10 +578,10 @@ jQuery.extend({
// Get the JavaScript object, if JSON is used. // Get the JavaScript object, if JSON is used.
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) { if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
// Try to use the native JSON parser first // Try to use the native JSON parser first
try { if ( window.JSON && window.JSON.parse ) {
data = JSON.parse( data ); data = window.JSON.parse( data );
} catch(e) { } else {
data = (new Function("return " + data))(); data = (new Function("return " + data))();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment