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