From cbcc2aa7314ffc38ea51b67ec5f13d679c1f48b8 Mon Sep 17 00:00:00 2001 From: j433866 Date: Thu, 9 May 2019 10:04:06 +0100 Subject: [PATCH] Fix regex to handle multiple escaped backslashes --- src/core/Utils.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index 59af74fb27..e4411fe049 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -836,7 +836,7 @@ class Utils { args = m[2] .replace(/"/g, '\\"') // Escape double quotes .replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with " - .replace(/([^\\]|[^\\]\\\\)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with " + .replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with " .replace(/\\'/g, "'"); // Unescape single quotes args = "[" + args + "]";