diff --git a/plugins/notifier/email/MessageNotifierEmail.class.php b/plugins/notifier/email/MessageNotifierEmail.class.php index b0e5da4..03424a0 100644 --- a/plugins/notifier/email/MessageNotifierEmail.class.php +++ b/plugins/notifier/email/MessageNotifierEmail.class.php @@ -1,10 +1,18 @@ plugin; $message = $this->message; @@ -16,19 +24,23 @@ public function deliver(array $output = array()) { $languages = language_list(); if (!$options['language override']) { - $lang = !empty($account->language) && $account->language != LANGUAGE_NONE ? $languages[$account->language]: language_default(); + $lang = !empty($account->language) && $account->language != LANGUAGE_NONE ? $languages[$account->language] : language_default(); } else { $lang = $languages[$message->language]; } - + // Start with basic clean-up to remove line-feeds etc. + $output['message_notify_email_subject'] = trim($output['message_notify_email_subject']); // The subject in an email can't be with HTML, so strip it. $output['message_notify_email_subject'] = strip_tags($output['message_notify_email_subject']); + // Decode entities. + $output['message_notify_email_subject'] = decode_entities($output['message_notify_email_subject']); // Pass the message entity along to hook_drupal_mail(). $output['message_entity'] = $message; - $result = drupal_mail('message_notify', $message->type, $mail, $lang, $output); + $result = drupal_mail('message_notify', $message->type, $mail, $lang, $output); + return $result['result']; }