Permalink
Browse files

fix(comments): email subject hook now validates array structure

When called directly elgg_send_email() would trigger a hook
without params being set, which resulted in email subject handler
in emitting a warning.

Fixes #9772
  • Loading branch information...
hypeJunction committed Apr 26, 2016
1 parent 7d64da4 commit 5df7f40b8cba8f5a61afcfbb4b3d2086d49b54ee
Showing with 5 additions and 1 deletion.
  1. +5 −1 engine/lib/comments.php
View
@@ -280,8 +280,12 @@ function _elgg_comments_notification_email_subject($hook, $type, $returnvalue, $
return;
}
if (empty($returnvalue['params']['notification'])) {
return;
}
/** @var Elgg\Notifications\Notification */
$notification = elgg_extract('notification', $returnvalue['params']);
$notification = $returnvalue['params']['notification'];
if ($notification instanceof Elgg\Notifications\Notification) {
$object = elgg_extract('object', $notification->params);

0 comments on commit 5df7f40

Please sign in to comment.