diff options
-rw-r--r-- | inc/fulltext.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index f2f071fc5..36a1b049d 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -11,6 +11,13 @@ /** + * Wrapper around preg_quote adding the default delimiter + */ +function ft_preg_quote_cb($string){ + return preg_quote($string,'/'); +} + +/** * The fulltext search * * Returns a list of matching documents for the given query @@ -69,7 +76,7 @@ function ft_pageSearch($query,&$poswords){ if(count($q['phrases'])){ //build a regexp $q['phrases'] = array_map('utf8_strtolower',$q['phrases']); - $q['phrases'] = array_map('preg_quote',$q['phrases']); + $q['phrases'] = array_map('ft_preg_quote_cb',$q['phrases']); $regex = '('.join('|',$q['phrases']).')'; // check the source of all documents for the exact phrases foreach(array_keys($docs) as $id){ |