From b8219d2d5e3003683926bd4f9d7bd37ca93b95ec Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 15 May 2009 12:11:12 +0200 Subject: fixed the media listing recursion limit check again Ignore-this: c1b12d1fbde51ee80e24fcd9b731a161 darcs-hash:20090515101112-7ad00-83140ea1f10f80ee691b4a70c00b8f990119c9c2.gz --- inc/search.php | 5 +++-- 1 file 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 */ 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; } -- cgit v1.2.3