phpBB

Code Changes

File: includes/functions_messenger.php

  Unmodified   Added   Modified   Removed
Line 37Line 37
	/**
* Constructor
*/

	/**
* Constructor
*/

	function messenger($use_queue = true)

	function __construct($use_queue = true)

	{
global $config;


	{
global $config;


Line 326Line 326
		));

$subject = $this->subject;

		));

$subject = $this->subject;

		$message = $this->msg;

		$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
* @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH

		*
* @event core.modify_notification_message
* @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH

Line 338Line 355
		* @var	string	message	The message text
* @since 3.1.11-RC1
*/

		* @var	string	message	The message text
* @since 3.1.11-RC1
*/

		$vars = array(
'method',
'break',
'subject',
'message',
);

		$vars = array('method', 'break', 'subject', 'message');






		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->msg = $message;

		$this->subject = $subject;
$this->msg = $message;

		unset($subject, $message);

// Parse message through template
$this->msg = trim($this->template->assign_display('body'));

		unset($subject, $message, $template);





// 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);


// 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);

Line 367Line 377
		else
{
$this->subject = (($this->subject != '') ? $this->subject : $user->lang['NO_EMAIL_SUBJECT']);

		else
{
$this->subject = (($this->subject != '') ? $this->subject : $user->lang['NO_EMAIL_SUBJECT']);

 
		}

if (preg_match('#^(List-Unsubscribe:(.*?))$#m', $this->msg, $match))
{
$this->extra_headers[] = $match[1];
$drop_header .= '[\r\n]*?' . preg_quote($match[1], '#');

		}

if ($drop_header)

		}

if ($drop_header)

Line 517Line 533
	*/
function msg_email()
{

	*/
function msg_email()
{

		global $config;

		global $config, $phpbb_dispatcher;


if (empty($config['email_enable']))
{


if (empty($config['email_enable']))
{

Line 544Line 560

$contact_name = htmlspecialchars_decode($config['board_contact_name']);
$board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>';


$contact_name = htmlspecialchars_decode($config['board_contact_name']);
$board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>';

 

$break = false;
$addresses = $this->addresses;
$subject = $this->subject;
$msg = $this->msg;
/**
* Event to send message via external transport
*
* @event core.notification_message_email
* @var bool break Flag indicating if the function return after hook
* @var array addresses The message recipients
* @var string subject The message subject
* @var string msg The message text
* @since 3.2.4-RC1
*/
$vars = array(
'break',
'addresses',
'subject',
'msg',
);
extract($phpbb_dispatcher->trigger_event('core.notification_message_email', compact($vars)));

if ($break)
{
return true;
}


if (empty($this->replyto))
{


if (empty($this->replyto))
{

Line 750Line 793
	/**
* constructor
*/

	/**
* constructor
*/

	function queue()

	function __construct()

	{
global $phpEx, $phpbb_root_path, $phpbb_filesystem, $phpbb_container;


	{
global $phpEx, $phpbb_root_path, $phpbb_filesystem, $phpbb_container;


Line 783Line 826
	*/
function process()
{

	*/
function process()
{

		global $config, $phpEx, $phpbb_root_path, $user;

		global $config, $phpEx, $phpbb_root_path, $user, $phpbb_dispatcher;


$lock = new \phpbb\lock\flock($this->cache_file);
$lock->acquire();


$lock = new \phpbb\lock\flock($this->cache_file);
$lock->acquire();

Line 880Line 923
				switch ($object)
{
case 'email':

				switch ($object)
{
case 'email':

 
						$break = false;
/**
* Event to send message via external transport
*
* @event core.notification_message_process
* @var bool break Flag indicating if the function return after hook
* @var array addresses The message recipients
* @var string subject The message subject
* @var string msg The message text
* @since 3.2.4-RC1
*/
$vars = array(
'break',
'addresses',
'subject',
'msg',
);
extract($phpbb_dispatcher->trigger_event('core.notification_message_process', compact($vars)));

if (!$break)
{

						$err_msg = '';
$to = (!$to) ? 'undisclosed-recipients:;' : $to;


						$err_msg = '';
$to = (!$to) ? 'undisclosed-recipients:;' : $to;


Line 897Line 961
							$messenger = new messenger();
$messenger->error('EMAIL', $err_msg);
continue 2;

							$messenger = new messenger();
$messenger->error('EMAIL', $err_msg);
continue 2;

 
							}

						}
break;


						}
break;


Line 1264Line 1329
	var $backtrace = false;
var $backtrace_log = array();


	var $backtrace = false;
var $backtrace_log = array();


	function smtp_class()

	function __construct()

	{
// Always create a backtrace for admins to identify SMTP problems
$this->backtrace = true;

	{
// Always create a backtrace for admins to identify SMTP problems
$this->backtrace = true;