From: mkanat%bugzilla.org <> Date: Wed, 20 Aug 2008 02:35:15 +0000 (+0000) Subject: A fix for bug 446645--make hyphens at the beginning of words still count as negation... X-Git-Tag: bugzilla-3.3.1~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20fb3d39980ab048132361631dfe8ee8e4e9a305;p=thirdparty%2Fbugzilla.git A fix for bug 446645--make hyphens at the beginning of words still count as negation for fulltext searching in MySQL. Patch By Jesse Clark r=mkanat, a=mkanat --- diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index d645d79c55..2f42f9f34e 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -157,10 +157,10 @@ sub sql_fulltext_search { $mode = 'IN BOOLEAN MODE'; # quote un-quoted compound words - my @words = quotewords('[\s()]+', 'delimiter', $text); + my @words = quotewords('[\s()]+', 'delimiters', $text); foreach my $word (@words) { - # match words that have word chars, non-word chars, and no quotes - if ($word =~ /\w/ && $word =~ m/\W/ && $word !~ m/"/) { + # match words that have non-word chars in the middle of them + if ($word =~ /\w\W+\w/ && $word !~ m/"/) { $word = '"' . $word . '"'; } }