summaryrefslogtreecommitdiff
path: root/inc/search.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/search.php')
-rw-r--r--inc/search.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/search.php b/inc/search.php
index dd5bda9be..2462cb240 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -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;
}