From 863714d30a8e80ccc7f262da9cade5c484059141 Mon Sep 17 00:00:00 2001 From: sunnavy Date: Thu, 16 Nov 2023 16:19:23 -0500 Subject: [PATCH] Make sure both prefix and suffix of spaces are removed Previously after parsing and reassembling, searches like "... AND ( id > 0 )" were changed to "... AND ( id > 0 )", note that an additional whitespace was added ahead of "id > 0". This commit fixes this issue. --- lib/RT/Interface/Web/QueryBuilder/Tree.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/RT/Interface/Web/QueryBuilder/Tree.pm b/lib/RT/Interface/Web/QueryBuilder/Tree.pm index 59365881da9..2b1f8cb5c12 100644 --- a/lib/RT/Interface/Web/QueryBuilder/Tree.pm +++ b/lib/RT/Interface/Web/QueryBuilder/Tree.pm @@ -297,7 +297,8 @@ sub __LinearizeTree { $str .= $key ." ". $op . " " . $value; } - $str =~ s/^\s+|\s+$//; + $str =~ s/^\s+//; + $str =~ s/\s+$//; push @$list, { NODE => $node,