diff options
author | lpsolit%gmail.com <> | 2008-10-29 05:30:26 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2008-10-29 05:30:26 +0000 |
commit | f3e86f279550a74627c8a876aa19b036a95b98a9 (patch) | |
tree | 4d1beb6d7f76b18a06aa3fb4c2e05e901a2b6038 | |
parent | Bug 460749: Firefox 3.1 no longer supports -moz-pre-wrap (nor does Opera!) - ... (diff) | |
download | bugzilla-f3e86f279550a74627c8a876aa19b036a95b98a9.tar.gz bugzilla-f3e86f279550a74627c8a876aa19b036a95b98a9.tar.bz2 bugzilla-f3e86f279550a74627c8a876aa19b036a95b98a9.zip |
Bug 461729: [PostgreSQL] Incorrect SQL is generated when searching for keywords with dashes in them - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
-rw-r--r-- | Bugzilla/Search.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 2673efaa9..ca12ad3d0 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -1622,12 +1622,9 @@ sub GetByWordList { my $word = $w; if ($word ne "") { $word =~ tr/A-Z/a-z/; - $word = $dbh->quote(quotemeta($word)); + $word = $dbh->quote('(^|[^a-z0-9])' . quotemeta($word) . '($|[^a-z0-9])'); trick_taint($word); - $word =~ s/^'//; - $word =~ s/'$//; - $word = '(^|[^a-z0-9])' . $word . '($|[^a-z0-9])'; - push(@list, $dbh->sql_regexp($field, "'$word'")); + push(@list, $dbh->sql_regexp($field, $word)); } } |