mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
jsParse: Disambiguate regex
Make it clear that /= is part of a regex and not an operator shorthand. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/710
This commit is contained in:
parent
f54e7804c5
commit
9f11fbad16
1 changed files with 1 additions and 1 deletions
|
|
@ -217,7 +217,7 @@ function isUnsafeExpression(str) {
|
|||
prunedStr = prunedStr.replace(/[=!]==/g, ''); //replace === and !== with nothing
|
||||
prunedStr = prunedStr.replace(/[=<>!]=/g, ''); //replace ==, <=, >=, != with nothing
|
||||
|
||||
if (prunedStr.match(/=/)) {
|
||||
if (prunedStr.match(/[=]/)) {
|
||||
return true;
|
||||
} else if (prunedStr.match(/;/)) {
|
||||
// If we contain a semicolon not inside of a quote/regex, assume we're unsafe as well
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue