Skip to content
Snippets Groups Projects
Commit 1c6c1c6c authored by Michael Hamann's avatar Michael Hamann
Browse files

Escape filename in regex in search_index()

This problem was reported in https://forum.dokuwiki.org/thread/8143.
Apart from warnings you could notice that when you have namespaces "foo"
and "f.o" and you open the sitemap for "foo" that "f.o" is opened, too.
parent cab75975
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,7 @@ function search_index(&$data,$base,$file,$type,$lvl,$opts){
'listfiles' => !$opts['nofiles'],
'sneakyacl' => $conf['sneaky_index'],
// Hacky, should rather use recmatch
'depth' => preg_match('#^'.$file.'(/|$)#','/'.$opts['ns']) ? 0 : -1
'depth' => preg_match('#^'.preg_quote($file, '#').'(/|$)#','/'.$opts['ns']) ? 0 : -1
);
return search_universal($data, $base, $file, $type, $lvl, $opts);
......
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