Issue #3432151 by Tom Konda, longwave: [jQuery 4] ajax.js and jquery.form.js use deprecated function $.parseJSON()

merge-requests/4936/head^2
nod_ 2024-03-20 21:37:06 +01:00
parent 9a06786e2f
commit a605d772b6
No known key found for this signature in database
GPG Key ID: 76624892606FA197
2 changed files with 2 additions and 6 deletions

View File

@ -554,7 +554,7 @@
// Sanity check for browser support (object expected).
// When using iFrame uploads, responses must be returned as a string.
if (typeof response === 'string') {
response = $.parseJSON(response);
response = JSON.parse(response);
}
// Prior to invoking the response's commands, verify that they can be

View File

@ -922,10 +922,6 @@
return (doc && doc.documentElement && doc.documentElement.nodeName !== 'parsererror') ? doc : null;
};
var parseJSON = $.parseJSON || function(s) {
/* jslint evil:true */
return window['eval']('(' + s + ')'); // eslint-disable-line dot-notation
};
var httpData = function(xhr, type, s) { // mostly lifted from jq1.4.4
@ -943,7 +939,7 @@
}
if (typeof data === 'string') {
if ((type === 'json' || !type) && ct.indexOf('json') >= 0) {
data = parseJSON(data);
data = JSON.parse(data);
} else if ((type === 'script' || !type) && ct.indexOf('javascript') >= 0) {
$.globalEval(data);
}