]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 970184: "possible duplicates" shouldn't truncate words at the first non-word...
authorByron Jones <bjones@mozilla.com>
Tue, 11 Feb 2014 05:03:15 +0000 (13:03 +0800)
committerByron Jones <bjones@mozilla.com>
Tue, 11 Feb 2014 05:03:15 +0000 (13:03 +0800)
r=dkl, a=glob

Bugzilla/Bug.pm

index a2a8827a51231d1d4c7d17c417a8ee00cdbde67e..a96731949c034763d2fedd64ef7df4e8cb869299 100644 (file)
@@ -522,8 +522,10 @@ sub possible_duplicates {
     my $dbh = Bugzilla->dbh;
     my $user = Bugzilla->user;
     my @words = split(/[\b\s]+/, $short_desc || '');
-    # Exclude punctuation from the array.
-    @words = map { /(\w+)/; $1 } @words;
+    # Remove leading/trailing punctuation from words
+    foreach my $word (@words) {
+        $word =~ s/(?:^\W+|\W+$)//g;
+    }
     # And make sure that each word is longer than 2 characters.
     @words = grep { defined $_ and length($_) > 2 } @words;