From 160b527dfce4fefbfece3942a3a88ac9adb766d3 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 13 Jan 2011 08:27:27 +0000 Subject: [PATCH] BUGFIX Fixed DocumentationViewer->_getModulePagesNested(), wasn't comparing anything lower than first level properly --- code/DocumentationViewer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/DocumentationViewer.php b/code/DocumentationViewer.php index 0ec7e82..761b216 100755 --- a/code/DocumentationViewer.php +++ b/code/DocumentationViewer.php @@ -432,7 +432,11 @@ class DocumentationViewer extends Controller { private function _getModulePagesNested(&$page, $module, $level = 0) { // only support 2 more levels if(isset($this->Remaining[$level])) { - if(strtolower($this->Remaining[$level]) == trim($page->Filename, '/')) { + // compare segment successively, e.g. with "changelogs/alpha/2.4.0-alpha", + // first comparison on $level=0 is against "changelogs", + // second comparison on $level=1 is against "changelogs/alpha", etc. + $segments = array_slice($this->Remaining, 0, $level+1); + if(strtolower(implode('/', $segments)) == trim($page->getRelativeLink(), '/')) { // its either in this section or is the actual link $page->LinkingMode = (isset($this->Remaining[$level + 1])) ? 'section' : 'current';