diff options
author | Byron Jones <bjones@mozilla.com> | 2013-06-07 13:27:25 +0800 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-06-07 13:27:25 +0800 |
commit | 8e16a58fe9a949c4344a41e007279278b476141d (patch) | |
tree | 487d51dac16aee4960befbf6c0f44cf4454d6333 /Bugzilla/Search.pm | |
parent | Bug 878035: Do not disclose whether a user account exists or not when a user ... (diff) | |
download | bugzilla-8e16a58fe9a949c4344a41e007279278b476141d.tar.gz bugzilla-8e16a58fe9a949c4344a41e007279278b476141d.tar.bz2 bugzilla-8e16a58fe9a949c4344a41e007279278b476141d.zip |
Bug 880315: Fix malformed sql generated by the fix for bug 879055
r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r-- | Bugzilla/Search.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 0f395bde9..7205f09c5 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -2926,14 +2926,14 @@ sub _anywordsubstr { my ($self, $args) = @_; my @terms = $self->_substring_terms($args); - $args->{term} = '(' . join("\n\tOR ", @terms) . ')'; + $args->{term} = @terms ? '(' . join("\n\tOR ", @terms) . ')' : ''; } sub _allwordssubstr { my ($self, $args) = @_; my @terms = $self->_substring_terms($args); - $args->{term} = '(' . join("\n\tAND ", @terms) . ')'; + $args->{term} = @terms ? '(' . join("\n\tAND ", @terms) . ')' : ''; } sub _nowordssubstr { @@ -2950,14 +2950,14 @@ sub _anywords { # 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} = @terms ? '(' . join("\n\tOR ", @terms) . ')' : ''; } sub _allwords { my ($self, $args) = @_; my @terms = $self->_word_terms($args); - $args->{term} = '(' . join("\n\tAND ", @terms) . ')'; + $args->{term} = @terms ? '(' . join("\n\tAND ", @terms) . ')' : ''; } sub _nowords { |