Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2018-10-28 12:08:51 +01:00
commit 8613a2d77f
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -326,10 +326,26 @@ class messenger
)); ));
$subject = $this->subject; $subject = $this->subject;
$message = $this->msg;
$template = $this->template; $template = $this->template;
/** /**
* Event to modify notification message text before parsing * Event to modify the template before parsing
*
* @event core.modify_notification_template
* @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
* @var bool break Flag indicating if the function only formats the subject
* and the message without sending it
* @var string subject The message subject
* @var \phpbb\template\template template The (readonly) template object
* @since 3.2.4-RC1
*/
$vars = array('method', 'break', 'subject', 'template');
extract($phpbb_dispatcher->trigger_event('core.modify_notification_template', compact($vars)));
// Parse message through template
$message = trim($this->template->assign_display('body'));
/**
* Event to modify notification message text after parsing
* *
* @event core.modify_notification_message * @event core.modify_notification_message
* @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH * @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
@ -337,24 +353,14 @@ class messenger
* and the message without sending it * and the message without sending it
* @var string subject The message subject * @var string subject The message subject
* @var string message The message text * @var string message The message text
* @var \phpbb\template\template template Template object
* @since 3.1.11-RC1 * @since 3.1.11-RC1
* @changed 3.2.4-RC1 Added template
*/ */
$vars = array( $vars = array('method', 'break', 'subject', 'message');
'method',
'break',
'subject',
'message',
'template',
);
extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars)));
$this->subject = $subject; $this->subject = $subject;
$this->msg = $message; $this->msg = $message;
unset($subject, $message); unset($subject, $message, $template);
// Parse message through template
$this->msg = trim($this->template->assign_display('body'));
// Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding // Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding
$this->msg = str_replace("\r\n", "\n", $this->msg); $this->msg = str_replace("\r\n", "\n", $this->msg);