Skip to content

Commit

Permalink
fix(notifications): smtp thread headers only set if still possible
Browse files Browse the repository at this point in the history
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 f3bb4ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engine/lib/notification.php
Expand Up @@ -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);
Expand Down

0 comments on commit f3bb4ac

Please sign in to comment.