mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 04:48:08 +01:00
Use JSON.parse rather than eval to parse strings.
--HG-- extra : transplant_source : %7B%40A%81%9F3%F4N%A7%0A%C37%A5%3D%D0%B9d%80%14%FE
This commit is contained in:
@@ -917,7 +917,7 @@ const Commands = Module("commands", {
|
||||
if ((res = re2.exec(str)))
|
||||
arg += keepQuotes ? res[0] : res[2].replace(/\\(.)/g, "$1");
|
||||
else if ((res = /^(")((?:[^\\"]|\\.)*)("?)/.exec(str)))
|
||||
arg += keepQuotes ? res[0] : window.eval(res[0] + (res[3] ? "" : '"'));
|
||||
arg += keepQuotes ? res[0] : JSON.parse(res[0] + (res[3] ? "" : '"'));
|
||||
else if ((res = /^(')((?:[^']|'')*)('?)/.exec(str)))
|
||||
arg += keepQuotes ? res[0] : res[2].replace("''", "'", "g");
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user