preg_quote search strings

This commit is contained in:
friendica 2011-12-06 19:51:19 -08:00
parent 7eba8adbf7
commit 341fcce75e
2 changed files with 4 additions and 11 deletions

View file

@ -364,8 +364,8 @@ function network_content(&$a, $update = 0) {
if(x($_GET,'search')) {
$search = escape_tags($_GET['search']);
$sql_extra .= sprintf(" AND ( `item`.`body` REGEXP '%s' OR `item`.`tag` REGEXP '%s' ) ",
dbesc($search),
dbesc('\\]' . $search . '\\[')
dbesc(preg_quote($search)),
dbesc('\\]' . preg_quote($search) . '\\[')
);
}