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,6 +361,9 @@
|
||||
var response;
|
||||
|
||||
try {
|
||||
if (typeof(JSON) != "undefined" && typeof(JSON.parse) != "undefined")
|
||||
response = JSON.parse(text);
|
||||
else
|
||||
response = eval('(' + text + ')');
|
||||
} catch (err) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user