aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/notification.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-12-14 14:21:32 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-12-14 14:21:32 -0200
commitf9ca24a9407f294a9bb7305180f9f8e740ab6ec9 (patch)
tree4c9a263b7fd770151e40940d6ddaa89d27e5053d /engine/lib/notification.php
parente15f0fce6940ee999cf5d6405ad1b16d00c38e4b (diff)
parent3ed289b03fa3d851fd7fffbc0441ebc9b5e98310 (diff)
downloadelgg-f9ca24a9407f294a9bb7305180f9f8e740ab6ec9.tar.gz
elgg-f9ca24a9407f294a9bb7305180f9f8e740ab6ec9.tar.bz2
Merge branch 'master' of git://gitorious.org/lorea/elgg into saravea
Diffstat (limited to 'engine/lib/notification.php')
-rw-r--r--engine/lib/notification.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index 18faff27f..9e3c075a8 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -38,7 +38,7 @@ $NOTIFICATION_HANDLERS = array();
function register_notification_handler($method, $handler, $params = NULL) {
global $NOTIFICATION_HANDLERS;
- if (is_callable($handler)) {
+ if (is_callable($handler, true)) {
$NOTIFICATION_HANDLERS[$method] = new stdClass;
$NOTIFICATION_HANDLERS[$method]->handler = $handler;
@@ -131,8 +131,9 @@ function notify_user($to, $from, $subject, $message, array $params = NULL, $meth
// Extract method details from list
$details = $NOTIFICATION_HANDLERS[$method];
$handler = $details->handler;
+ /* @var callable $handler */
- if ((!$NOTIFICATION_HANDLERS[$method]) || (!$handler)) {
+ if ((!$NOTIFICATION_HANDLERS[$method]) || (!$handler) || (!is_callable($handler))) {
error_log(elgg_echo('NotificationException:NoHandlerFound', array($method)));
}
@@ -140,7 +141,7 @@ function notify_user($to, $from, $subject, $message, array $params = NULL, $meth
// Trigger handler and retrieve result.
try {
- $result[$guid][$method] = $handler(
+ $result[$guid][$method] = call_user_func($handler,
$from ? get_entity($from) : NULL, // From entity
get_entity($guid), // To entity
$subject, // The subject