summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-06-05 07:29:58 +0200
committerByron Jones <bjones@mozilla.com>2013-06-05 07:29:58 +0200
commit9da412006c554d22865913d05b111cf01408e346 (patch)
treee9b07e49ff57a2b161033c5604c61c631046775d /Bugzilla
parent5a316423e84c0ab8ca7310e12694cae05a774a12 (diff)
downloadbugzilla-9da412006c554d22865913d05b111cf01408e346.tar.gz
bugzilla-9da412006c554d22865913d05b111cf01408e346.tar.xz
Bug 879055: Add parenthesis to prevent anywordssubstr search from returning incorrect results.
r=glob, a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index a91a25b06..0f395bde9 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -2682,7 +2682,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)";
}
}
@@ -2926,14 +2926,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 {
@@ -2945,19 +2945,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 {