From 9a0f193a522c7128d7d9585a84d7d75cbd416cd6 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 2 May 2010 17:49:25 +0000 Subject: Fixes #1480 - not passing empty array element from page_handler() git-svn-id: http://code.elgg.org/elgg/trunk@5939 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/pagehandler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index 8d0f9abee..fc11f2d67 100644 --- a/engine/lib/pagehandler.php +++ b/engine/lib/pagehandler.php @@ -33,8 +33,11 @@ function page_handler($handler, $page) { } } - // if page url ends in a / then last element of $page is an empty string - $page = explode('/',$page); + $page = explode('/', $page); + // remove empty array element when page url ends in a / (see #1480) + if ($page[count($page) - 1] === '') { + array_pop($page); + } if (!isset($CONFIG->pagehandler) || empty($handler)) { $result = false; -- cgit v1.2.3