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

fixed depth checking in search_(media|allpages)

darcs-hash:20090301192434-7ad00-aa49d6b371e3832e4c45c89ac8ffd367d278c74c.gz
parent 224122cf
No related branches found
No related tags found
No related merge requests found
......@@ -188,7 +188,7 @@ function search_media(&$data,$base,$file,$type,$lvl,$opts){
//we do nothing with directories
if($type == 'd') {
if(!$opts['depth']) return true; // recurse forever
$parts = explode('/',$file);
$parts = explode('/',ltrim($file,'/'));
if(count($parts) == $opts['depth']) return false; // depth reached
return true;
return ($opts['recursive']);
......@@ -293,7 +293,7 @@ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
//we do nothing with directories
if($type == 'd'){
if(!$opts['depth']) return true; // recurse forever
$parts = explode('/',$file);
$parts = explode('/',ltrim($file,'/'));
if(count($parts) == $opts['depth']) return false; // depth reached
return true;
}
......
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