]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 997281: New QuickSearch operators can short-circuit each other depending on which...
authorFrédéric Buclin <LpSolit@gmail.com>
Wed, 16 Apr 2014 20:03:04 +0000 (22:03 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 16 Apr 2014 20:03:04 +0000 (22:03 +0200)
r/a=justdave

Bugzilla/Search/Quicksearch.pm

index 1a88234889fa6232ce94114eefb5f3509a861a65..98e8a64827497efdab0a70ec1d2c821e5d01a7ac 100644 (file)
@@ -402,7 +402,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]);