From da6eadf33bb78d394f8cc4d51c501c1f92339c43 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Tue, 20 May 2014 22:41:21 -0700 Subject: [PATCH] Fix regex warning message --- www/js/util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/js/util.js b/www/js/util.js index 2522d513..f15a88e1 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2160,13 +2160,13 @@ function checkEntitiesInStr(str) { ">": ">", '"': """, "'": "'", - "(": "(", - ")": ")" + "\\(": "(", + "\\)": ")" }; - var m = str.match(/([&<>"'\(\)])/); + var m = str.match(/([&<>"'])|(\\\()|(\\\))/); if (m && m[1] in entities) { - return { src: m[1], replace: entities[m[1]] }; + return { src: m[1].replace(/^\\/, ""), replace: entities[m[1]] }; } else { return false; }