diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-02 17:49:25 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-02 17:49:25 +0000 |
commit | 9a0f193a522c7128d7d9585a84d7d75cbd416cd6 (patch) | |
tree | a7c575d5ac1e3a198596df33a56c32972cbb884f /engine/lib/pagehandler.php | |
parent | 58600dd1e5de1d77d6f075b9dae2f365dec67b5d (diff) | |
download | elgg-9a0f193a522c7128d7d9585a84d7d75cbd416cd6.tar.gz elgg-9a0f193a522c7128d7d9585a84d7d75cbd416cd6.tar.bz2 |
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
Diffstat (limited to 'engine/lib/pagehandler.php')
-rw-r--r-- | engine/lib/pagehandler.php | 7 |
1 files changed, 5 insertions, 2 deletions
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; |