diff options
author | Byron Jones <bjones@mozilla.com> | 2014-02-11 13:03:47 +0800 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2014-02-11 13:03:47 +0800 |
commit | f4c9234a92caf2b52d5bc70621a2fd251f476690 (patch) | |
tree | 59ba08029f3cb1096749c9d325090fc2e7b1cc8d | |
parent | Bug 926085: Forbird single quotes to delimit URLs (no <a href='...'>) (diff) | |
download | bugzilla-f4c9234a92caf2b52d5bc70621a2fd251f476690.tar.gz bugzilla-f4c9234a92caf2b52d5bc70621a2fd251f476690.tar.bz2 bugzilla-f4c9234a92caf2b52d5bc70621a2fd251f476690.zip |
Bug 970184: "possible duplicates" shouldn't truncate words at the first non-word character
r=dkl, a=glob
-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 e981eb800..beb756da5 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -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; |