From 9f11fbad1674a376249236faf90b3681feb587d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 20 Aug 2019 23:20:31 +0200 Subject: [PATCH] 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 05ab42337..43e99cabc 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