diff options
author | Byron Jones <bjones@mozilla.com> | 2014-02-11 06:03:15 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2014-02-11 06:03:15 +0100 |
commit | ccbeca7150a295e3a5b3fade2f2b07247dcb4d16 (patch) | |
tree | eb02b53c238302866caf79ce575830d59c63f29f | |
parent | bcb9385d13ce2671702323f5b1a90c4d61dcc995 (diff) | |
download | bugzilla-ccbeca7150a295e3a5b3fade2f2b07247dcb4d16.tar.gz bugzilla-ccbeca7150a295e3a5b3fade2f2b07247dcb4d16.tar.xz |
Bug 970184: "possible duplicates" shouldn't truncate words at the first non-word character
r=dkl, a=glob
-rw-r--r-- | Bugzilla/Bug.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index a2a8827a5..a96731949 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -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; |