From d531de86cf1fb9e1fb09c55959822c60c5bad993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Goetz?= Date: Sun, 19 Jul 2015 01:16:04 +0200 Subject: [PATCH] Cleaned getFirstPage a bit --- libs/Tree/Directory.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/Tree/Directory.php b/libs/Tree/Directory.php index b6461da..1e1851c 100644 --- a/libs/Tree/Directory.php +++ b/libs/Tree/Directory.php @@ -66,16 +66,11 @@ class Directory extends Entry return $this->first_page; } - if (!$this instanceof Directory) { - return false; - } - // First we try to find a real page foreach ($this->getEntries() as $node) { if ($node instanceof Content) { - // TODO :: this condition looks weird ... - if (!$node->getParent() && $node->getTitle() == 'index') { - //the homepage should not count as first page + if ($this instanceof Root && $this->getIndexPage() == $node) { + // The homepage should not count as first page continue; }