summaryrefslogtreecommitdiff
path: root/inc/search.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2013-02-20 20:18:59 +0100
committerMichael Hamann <michael@content-space.de>2013-02-20 20:45:49 +0100
commit5737a81e37e630de02f54e4e6304ede226159306 (patch)
tree9490f1c24edede34cf6ed93b477bfba1325079ec /inc/search.php
parent6416b708d3d115a6d7529b6c388c796fcb651d55 (diff)
downloadrpg-5737a81e37e630de02f54e4e6304ede226159306.tar.gz
rpg-5737a81e37e630de02f54e4e6304ede226159306.tar.bz2
Revert the search depth behavior changes from #154
This reverts parts of the changes from #154: Before merging the pull request, a depth of 1 returned just the pages in the root namespace. With the changes in the pull request, a depth of 1 also returned pages in subnamespaces of the root namespace (as it was also tested in the test case). This reverts this part of the changes and a depth of 1 returns just the pages in the root namespace again.
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 e4aa3b9eb..6927fff5f 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -243,8 +243,8 @@ function search_pagename(&$data,$base,$file,$type,$lvl,$opts){
function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
if(isset($opts['depth']) && $opts['depth']){
$parts = explode('/',ltrim($file,'/'));
- if(($type == 'd' && count($parts) > $opts['depth'])
- || ($type != 'd' && count($parts) > $opts['depth'] + 1)){
+ if(($type == 'd' && count($parts) >= $opts['depth'])
+ || ($type != 'd' && count($parts) > $opts['depth'])){
return false; // depth reached
}
}