diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-05-15 12:11:12 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-05-15 12:11:12 +0200 |
commit | b8219d2d5e3003683926bd4f9d7bd37ca93b95ec (patch) | |
tree | c4a4360c1548b912f6205692761894b395f94214 | |
parent | d3c26bc30cd5c85635df8014a550b453ec0304be (diff) | |
download | rpg-b8219d2d5e3003683926bd4f9d7bd37ca93b95ec.tar.gz rpg-b8219d2d5e3003683926bd4f9d7bd37ca93b95ec.tar.bz2 |
fixed the media listing recursion limit check again
Ignore-this: c1b12d1fbde51ee80e24fcd9b731a161
darcs-hash:20090515101112-7ad00-83140ea1f10f80ee691b4a70c00b8f990119c9c2.gz
-rw-r--r-- | inc/search.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/search.php b/inc/search.php index 609313594..070a3be00 100644 --- a/inc/search.php +++ b/inc/search.php @@ -185,11 +185,12 @@ function search_namespaces(&$data,$base,$file,$type,$lvl,$opts){ * @author Andreas Gohr <andi@splitbrain.org> */ 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('/',ltrim($file,'/')); - if(count($parts) == $opts['depth']) return false; // depth reached + $depth = substr_count(ltrim($file,'/'),'/'); + if($depth >= $opts['depth']) return false; // depth reached return true; } |