summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/search.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/search.php b/inc/search.php
index 070a3be00..bf6d59ac6 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -189,7 +189,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
- $depth = substr_count(ltrim($file,'/'),'/');
+ $depth = substr_count($file,'/');
if($depth >= $opts['depth']) return false; // depth reached
return true;
}