summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-04-22 08:08:55 +0200
committerByron Jones <glob@mozilla.com>2014-04-22 08:08:55 +0200
commitf9c6ea7a301ccd9b903574a3a3e3600db824c9f6 (patch)
treefb439fa84cacda4fb61fac0afa51fa8651dd8176
parentf8e099a25492dfa670fa86dff9842b6794da3387 (diff)
downloadbugzilla-f9c6ea7a301ccd9b903574a3a3e3600db824c9f6.tar.gz
bugzilla-f9c6ea7a301ccd9b903574a3a3e3600db824c9f6.tar.xz
Bug 997281: New QuickSearch operators can short-circuit each other depending on which ones are tested first
-rw-r--r--Bugzilla/Search/Quicksearch.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm
index 6f0f8c939..00a970292 100644
--- a/Bugzilla/Search/Quicksearch.pm
+++ b/Bugzilla/Search/Quicksearch.pm
@@ -436,7 +436,11 @@ sub _handle_field_names {
# Generic field1,field2,field3:value1,value2 notation.
# We have to correctly ignore commas and colons in quotes.
- foreach my $symbol (keys %{ OPERATOR_SYMBOLS() }) {
+ # Longer operators must be tested first as we don't want single character
+ # operators such as <, > and = to be tested before <=, >= and !=.
+ my @operators = sort { length($b) <=> length($a) } keys %{ OPERATOR_SYMBOLS() };
+
+ foreach my $symbol (@operators) {
my @field_values = _parse_line($symbol, 1, $or_operand);
next unless scalar @field_values == 2;
my @fields = _parse_line(',', 1, $field_values[0]);