From bfc3ff436d2debb58e4f0ef14aa9e1be0c7e8a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 16 Sep 2022 23:36:30 +0200 Subject: [PATCH] Strip only one wildcard issue11682 review443571003 --- src/common.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/common.js b/src/common.js index 6f785b9633..ccfcde0ada 100644 --- a/src/common.js +++ b/src/common.js @@ -1890,11 +1890,9 @@ is_full_text: function(value, escape) { escape = escape || '\\'; var escaped = value; - while (escaped.charAt(0) == '%') { - escaped = escaped.substring(1); - } - while (escaped.charAt(escaped.length - 1) == '%') { - escaped = escaped.substring(0, escaped.length - 1); + if ((escaped.charAt(0) == '%') && + (escaped.charAt(escaped.length - 1) == '%')) { + escaped = escaped.slice(1, -1); } escaped = escaped .replace(escape + '%', '')