]> 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:47 +0000 (13:03 +0800)
committerByron Jones <bjones@mozilla.com>
Tue, 11 Feb 2014 05:03:47 +0000 (13:03 +0800)
r=dkl, a=glob

Bugzilla/Bug.pm

index e981eb800ca7a9aab8a76b756ebb4128c2c856af..beb756da54dc4e4661b60e530fa967f8bf24f6c7 100644 (file)
@@ -511,8 +511,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;