Commit 09d4f0e3 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 461729: [PostgreSQL] Incorrect SQL is generated when searching for keywords…

Bug 461729: [PostgreSQL] Incorrect SQL is generated when searching for keywords with dashes in them - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 791b5047
......@@ -879,12 +879,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));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment