aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/pagehandler.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-12-07 23:55:12 +0100
committerSem <sembrestels@riseup.net>2012-12-07 23:55:12 +0100
commit3ed289b03fa3d851fd7fffbc0441ebc9b5e98310 (patch)
treeb2c8d2d7f569f0e3e7bfa6711cef96f806aea9f1 /engine/lib/pagehandler.php
parent2b2af5392f0daadc22a1db04aa17c17d4dd37c65 (diff)
parentccf7abb4b2b94781f9b67a6cf8798994aa1cca0d (diff)
downloadelgg-3ed289b03fa3d851fd7fffbc0441ebc9b5e98310.tar.gz
elgg-3ed289b03fa3d851fd7fffbc0441ebc9b5e98310.tar.bz2
Merge tag '1.8.11' of git://github.com/Elgg/Elgg
Elgg 1.8.11 release
Diffstat (limited to 'engine/lib/pagehandler.php')
-rw-r--r--engine/lib/pagehandler.php10
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;
}