aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-02-20 13:37:13 +0800
committerByron Jones <glob@mozilla.com>2015-02-20 13:37:13 +0800
commit9f1e3658e40902f829f4fe41df878ce8ac288010 (patch)
tree8eaf593423af3619c5e03354a092162885c11c01 /Bugzilla/DB
parentBug 1134736: urlbase must be HTML-filtered in rest.html.tmpl (diff)
downloadbugzilla-9f1e3658e40902f829f4fe41df878ce8ac288010.tar.gz
bugzilla-9f1e3658e40902f829f4fe41df878ce8ac288010.tar.bz2
bugzilla-9f1e3658e40902f829f4fe41df878ce8ac288010.zip
Bug 1088086: Possible duplicate search doesn't return any results if you input "a->b" (for any a/b)
r=dylan,a=glob
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Mysql.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 02cc8bc10..d0915f1e6 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -184,15 +184,19 @@ sub sql_fulltext_search {
if ($text =~ /(?:^|\W)[+\-<>~"()]/ || $text =~ /[()"*](?:$|\W)/) {
$mode = 'IN BOOLEAN MODE';
- # quote un-quoted compound words
- my @words = quotewords('[\s()]+', 'delimiters', $text);
- foreach my $word (@words) {
- # match words that have non-word chars in the middle of them
- if ($word =~ /\w\W+\w/ && $word !~ m/"/) {
- $word = '"' . $word . '"';
+ my @terms = split(quotemeta(FULLTEXT_OR), $text);
+ foreach my $term (@terms) {
+ # quote un-quoted compound words
+ my @words = quotewords('[\s()]+', 'delimiters', $term);
+ foreach my $word (@words) {
+ # match words that have non-word chars in the middle of them
+ if ($word =~ /\w\W+\w/ && $word !~ m/"/) {
+ $word = '"' . $word . '"';
+ }
}
+ $term = join('', @words);
}
- $text = join('', @words);
+ $text = join(FULLTEXT_OR, @terms);
}
# quote the text for use in the MATCH AGAINST expression