mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-26 06:46:32 +00:00
Update src/jquery.autocomplete.js
Using the native JSON.parse built-in function in the browsers if it's available. Adds more security to it, so the autocomplete is less prone to XSS attacks.
This commit is contained in:
parent
8211e43cfd
commit
88bdbaf787
@ -361,7 +361,10 @@
|
|||||||
var response;
|
var response;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response = eval('(' + text + ')');
|
if (typeof(JSON) != "undefined" && typeof(JSON.parse) != "undefined")
|
||||||
|
response = JSON.parse(text);
|
||||||
|
else
|
||||||
|
response = eval('(' + text + ')');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user