Skip to content
Snippets Groups Projects
Commit d7d7bed5 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fix for slashes in phrase search #1066

darcs-hash:20070205191848-7ad00-77ad5a398534a7a64884e155c4607350e0f25a7c.gz
parent e0e755d7
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,13 @@
require_once(DOKU_INC.'inc/indexer.php');
/**
* Wrapper around preg_quote adding the default delimiter
*/
function ft_preg_quote_cb($string){
return preg_quote($string,'/');
}
/**
* The fulltext search
*
......@@ -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){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment