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:
parent
6f28066c2f
commit
050bf4ebac
@ -1 +1 @@
|
|||||||
8914
|
8915
|
||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user