diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-12-14 14:21:32 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-12-14 14:21:32 -0200 |
commit | f9ca24a9407f294a9bb7305180f9f8e740ab6ec9 (patch) | |
tree | 4c9a263b7fd770151e40940d6ddaa89d27e5053d /engine/lib/pagehandler.php | |
parent | e15f0fce6940ee999cf5d6405ad1b16d00c38e4b (diff) | |
parent | 3ed289b03fa3d851fd7fffbc0441ebc9b5e98310 (diff) | |
download | elgg-f9ca24a9407f294a9bb7305180f9f8e740ab6ec9.tar.gz elgg-f9ca24a9407f294a9bb7305180f9f8e740ab6ec9.tar.bz2 |
Merge branch 'master' of git://gitorious.org/lorea/elgg into saravea
Diffstat (limited to 'engine/lib/pagehandler.php')
-rw-r--r-- | engine/lib/pagehandler.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index ba7518a77..0cf99b6fe 100644 --- a/engine/lib/pagehandler.php +++ b/engine/lib/pagehandler.php @@ -45,7 +45,10 @@ function page_handler($handler, $page) { $page = $request['segments']; $result = false; - if (isset($CONFIG->pagehandler) && !empty($handler) && isset($CONFIG->pagehandler[$handler])) { + if (isset($CONFIG->pagehandler) + && !empty($handler) + && isset($CONFIG->pagehandler[$handler]) + && is_callable($CONFIG->pagehandler[$handler])) { $function = $CONFIG->pagehandler[$handler]; $result = call_user_func($function, $page, $handler); } @@ -76,14 +79,15 @@ function page_handler($handler, $page) { * @param string $handler The page type to handle * @param string $function Your function name * - * @return true|false Depending on success + * @return bool Depending on success */ function elgg_register_page_handler($handler, $function) { global $CONFIG; + if (!isset($CONFIG->pagehandler)) { $CONFIG->pagehandler = array(); } - if (is_callable($function)) { + if (is_callable($function, true)) { $CONFIG->pagehandler[$handler] = $function; return true; } |