From bca69cb581e73806adbb0506ff7acc82f1c02a63 Mon Sep 17 00:00:00 2001 From: Kirill Roskolii Date: Tue, 13 Oct 2015 17:05:31 +1300 Subject: [PATCH] Issue #2386273 by alfaguru, Andy_D, RoSk0: Decode HTML entities in subject. --- .../email/MessageNotifierEmail.class.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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']; }