summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-03-01 20:24:34 +0100
committerAndreas Gohr <andi@splitbrain.org>2009-03-01 20:24:34 +0100
commit17ff9c04665a46320fd67285fb3dcf26eb5f3e0e (patch)
tree0209c3a1a644c3cadea3fd33210fa391b2f3a228 /inc
parent224122cf976599e1fc256224095d84c4e0827e1a (diff)
downloadrpg-17ff9c04665a46320fd67285fb3dcf26eb5f3e0e.tar.gz
rpg-17ff9c04665a46320fd67285fb3dcf26eb5f3e0e.tar.bz2
fixed depth checking in search_(media|allpages)
darcs-hash:20090301192434-7ad00-aa49d6b371e3832e4c45c89ac8ffd367d278c74c.gz
Diffstat (limited to 'inc')
-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;
}