Permalink
Browse files

fix(notifications): smtp thread headers only set if still possible

If a plugin hook send the e-mail notification before this hook php
warnings occurred.
  • Loading branch information...
jeabakker committed Apr 5, 2016
1 parent 39a901e commit f3bb4ac43b6c14b6367fa17960cd95d2bb6dcb98
Showing with 5 additions and 0 deletions.
  1. +5 −0 engine/lib/notification.php
@@ -238,6 +238,11 @@ function _elgg_send_email_notification($hook, $type, $result, $params) {
*/
function _elgg_notifications_smtp_thread_headers($hook, $type, $returnvalue, $params) {
if (!is_array($returnvalue) || !is_array($returnvalue['params'])) {
// another hook handler returned a non-array, let's not override it
return;
}
$notificationParams = elgg_extract('params', $returnvalue, array());
/** @var \Elgg\Notifications\Notification */
$notification = elgg_extract('notification', $notificationParams);

0 comments on commit f3bb4ac

Please sign in to comment.