diff options
author | Byron Jones <bjones@mozilla.com> | 2014-02-11 06:05:24 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2014-02-11 06:05:24 +0100 |
commit | a1da4205492830a812f5661ee3b4faa224844b85 (patch) | |
tree | 803071b5f18139a4b3e55bd8a19bd734b21d95aa /Bugzilla | |
parent | e551a3c17b2207324761b91e02f03c7f84fbc6ea (diff) | |
download | bugzilla-a1da4205492830a812f5661ee3b4faa224844b85.tar.gz bugzilla-a1da4205492830a812f5661ee3b4faa224844b85.tar.xz |
Bug 970184: "possible duplicates" shouldn't truncate words at the first non-word character
Diffstat (limited to 'Bugzilla')
-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 c3c9a2a2c..7dc2113e1 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -530,8 +530,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; |