[gnome-shell] jsParse: Disambiguate regex
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] jsParse: Disambiguate regex
- Date: Wed, 11 Sep 2019 21:14:11 +0000 (UTC)
commit 9f11fbad1674a376249236faf90b3681feb587d6
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Aug 20 23:20:31 2019 +0200
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
js/misc/jsParse.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/misc/jsParse.js b/js/misc/jsParse.js
index 05ab42337b..43e99cabcf 100644
--- a/js/misc/jsParse.js
+++ b/js/misc/jsParse.js
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]