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

r=dkl, a=glob


git-svn-id: svn://10.0.0.236/trunk@265236 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2014-02-11 05:15:54 +00:00
parent 6f28066c2f
commit 050bf4ebac
2 changed files with 5 additions and 3 deletions

View File

@ -1 +1 @@
8914 8915

View File

@ -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;