diff options
author | Guillaume Turri <guillaume.turri@gmail.com> | 2013-01-21 21:29:06 +0100 |
---|---|---|
committer | Guillaume Turri <guillaume.turri@gmail.com> | 2013-01-21 21:47:43 +0100 |
commit | 05074c7596bd0f90791cb40cf23c9852a777f561 (patch) | |
tree | 5e01fc48c585e8b31ae2954f26795569b823022a | |
parent | 3fed52e12907b55aa9542b8d0da42c3992f8384f (diff) | |
parent | ad4665dacc59ec9fd68631764253a87d55ec05b0 (diff) | |
download | rpg-05074c7596bd0f90791cb40cf23c9852a777f561.tar.gz rpg-05074c7596bd0f90791cb40cf23c9852a777f561.tar.bz2 |
Merge remote-tracking branch 'origin/master' into addedUTests
Hurray, tests pass!
-rw-r--r-- | inc/RemoteAPICore.php | 4 | ||||
-rw-r--r-- | inc/search.php | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php index c04a14f5c..fef0b81dd 100644 --- a/inc/RemoteAPICore.php +++ b/inc/RemoteAPICore.php @@ -654,7 +654,9 @@ class RemoteAPICore { if(count($revisions)>0 && $first==0) { array_unshift($revisions, ''); // include current revision - array_pop($revisions); // remove extra log entry + if ( count($revisions) > $conf['recent'] ){ + array_pop($revisions); // remove extra log entry + } } if(count($revisions) > $conf['recent']) { diff --git a/inc/search.php b/inc/search.php index 1cecfd5ec..53bd240e8 100644 --- a/inc/search.php +++ b/inc/search.php @@ -247,11 +247,16 @@ function search_pagename(&$data,$base,$file,$type,$lvl,$opts){ * @author Andreas Gohr <andi@splitbrain.org> */ 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)){ + return false; // depth reached + } + } + //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 return true; } |