aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/pagehandler.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-04 23:29:54 -0400
committercash <cash.costello@gmail.com>2011-11-04 23:29:54 -0400
commit0759c227bf7b73254cf6eb5e8502463875f2469f (patch)
tree556d4d4b1ed2f2032694fa1f1ac28e41f19663f8 /engine/lib/pagehandler.php
parent54773892f88f53231b85d08d86d11557121d9609 (diff)
downloadelgg-0759c227bf7b73254cf6eb5e8502463875f2469f.tar.gz
elgg-0759c227bf7b73254cf6eb5e8502463875f2469f.tar.bz2
Fixes #4059 returning true when handling a page
Diffstat (limited to 'engine/lib/pagehandler.php')
-rw-r--r--engine/lib/pagehandler.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php
index 91e568c1d..f331e2aae 100644
--- a/engine/lib/pagehandler.php
+++ b/engine/lib/pagehandler.php
@@ -40,12 +40,13 @@ function page_handler($handler, $page) {
$handler = $params['handler'];
$page = $params['segments'];
+ $result = false;
if (isset($CONFIG->pagehandler) && !empty($handler) && isset($CONFIG->pagehandler[$handler])) {
$function = $CONFIG->pagehandler[$handler];
- call_user_func($function, $page, $handler);
+ $result = call_user_func($function, $page, $handler);
}
- return headers_sent();
+ return $result || headers_sent();
}
/**
@@ -64,6 +65,7 @@ function page_handler($handler, $page) {
* The context is set to the page handler identifier before the registered
* page handler function is called. For the above example, the context is set to 'blog'.
*
+ * Page handlers should return true to indicate that they handled the request.
* Requests not handled are forwarded to the front page with a reason of 404.
* Plugins can register for the 'forward', '404' plugin hook. @see forward()
*