]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 879055: Add parenthesis to prevent anywordssubstr search from returning incorrect...
authorSimon Green <sgreen@redhat.com>
Wed, 5 Jun 2013 05:31:24 +0000 (13:31 +0800)
committerByron Jones <bjones@mozilla.com>
Wed, 5 Jun 2013 05:31:24 +0000 (13:31 +0800)
r=glob, a=LpSolit

Bugzilla/Search.pm

index 795eb2afc6d56efb78c6473509a6e9807c85a5bb..6c5e04088bb7da822a717b1ba964f31ff73f7cc6 100644 (file)
@@ -2659,7 +2659,7 @@ sub _owner_idle_time_greater_less {
             "$ld_table.who IS NULL AND $act_table.who IS NULL";
     } else {
          $args->{term} =
-            "$ld_table.who IS NOT NULL OR $act_table.who IS NOT NULL";
+            "($ld_table.who IS NOT NULL OR $act_table.who IS NOT NULL)";
     }
 }
 
@@ -2903,14 +2903,14 @@ sub _anywordsubstr {
     my ($self, $args) = @_;
 
     my @terms = $self->_substring_terms($args);
-    $args->{term} = join("\n\tOR ", @terms);
+    $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
 }
 
 sub _allwordssubstr {
     my ($self, $args) = @_;
 
     my @terms = $self->_substring_terms($args);
-    $args->{term} = join("\n\tAND ", @terms);
+    $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
 }
 
 sub _nowordssubstr {
@@ -2922,19 +2922,19 @@ sub _nowordssubstr {
 
 sub _anywords {
     my ($self, $args) = @_;
-    
+
     my @terms = $self->_word_terms($args);
     # Because _word_terms uses AND, we need to parenthesize its terms
     # if there are more than one.
     @terms = map("($_)", @terms) if scalar(@terms) > 1;
-    $args->{term} = join("\n\tOR ", @terms);
+    $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
 }
 
 sub _allwords {
     my ($self, $args) = @_;
-    
+
     my @terms = $self->_word_terms($args);
-    $args->{term} = join("\n\tAND ", @terms);
+    $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
 }
 
 sub _nowords {