mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-22 21:05:12 +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;
|
||||
|
||||
try {
|
||||
response = eval('(' + text + ')');
|
||||
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