Commit f4c9234a authored by Byron Jones's avatar Byron Jones

Bug 970184: "possible duplicates" shouldn't truncate words at the first non-word character

r=dkl, a=glob
parent c5b78d99
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment