changeset f6d3baace8db in sao:default
details: https://hg.tryton.org/sao?cmd=changeset&node=f6d3baace8db
description:
Strip only one wildcard
issue11682
review443571003
diffstat:
src/common.js | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diffs (18 lines):
diff -r d096fc464434 -r f6d3baace8db src/common.js
--- a/src/common.js Thu Sep 15 21:36:56 2022 +0200
+++ b/src/common.js Fri Sep 16 23:36:30 2022 +0200
@@ -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 + '%', '')