diff options
author | Steve Clay <steve@mrclay.org> | 2012-09-17 17:41:15 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-11-14 21:09:42 -0500 |
commit | 3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3 (patch) | |
tree | 1c21fd8f55bebeeedf4790aaa0e5e2f76e3a93eb /engine/lib/pagehandler.php | |
parent | 7c6e3578ca8ab3e703852629e82b478265833d29 (diff) | |
download | elgg-3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3.tar.gz elgg-3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3.tar.bz2 |
Fixes #4861: allow lazy-loading for static method callbacks, allow more callables
Diffstat (limited to 'engine/lib/pagehandler.php')
-rw-r--r-- | engine/lib/pagehandler.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index ba7518a77..a53506812 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,14 @@ 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; } |