phpBB

Code Changes

File: includes/functions_messenger.php

  Unmodified   Added   Modified   Removed
Line 320Line 320
		// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(
'U_BOARD' => generate_board_url(),

		// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(
'U_BOARD' => generate_board_url(),

			'EMAIL_SIG'	=> str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'], ENT_COMPAT)),
'SITENAME' => htmlspecialchars_decode($config['sitename'], ENT_COMPAT),

			'EMAIL_SIG'	=> str_replace('<br />', "\n", "-- \n" . html_entity_decode($config['board_email_sig'], ENT_COMPAT)),
'SITENAME' => html_entity_decode($config['sitename'], ENT_COMPAT),

		));

$subject = $this->subject;

		));

$subject = $this->subject;

Line 427Line 427
			$user->session_begin();
}


			$user->session_begin();
}


		$calling_page = htmlspecialchars_decode($request->server('PHP_SELF'), ENT_COMPAT);

		$calling_page = html_entity_decode($request->server('REQUEST_URI'), ENT_COMPAT);


switch ($type)
{


switch ($type)
{

Line 557Line 557
			$use_queue = true;
}


			$use_queue = true;
}


		$contact_name = htmlspecialchars_decode($config['board_contact_name'], ENT_COMPAT);

		$contact_name = html_entity_decode($config['board_contact_name'], ENT_COMPAT);

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

$break = false;

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

$break = false;

Line 581Line 581
			'msg',
);
extract($phpbb_dispatcher->trigger_event('core.notification_message_email', compact($vars)));

			'msg',
);
extract($phpbb_dispatcher->trigger_event('core.notification_message_email', compact($vars)));

 

$this->addresses = $addresses;
$this->subject = $subject;
$this->msg = $msg;
unset($addresses, $subject, $msg);


if ($break)
{


if ($break)
{

Line 597Line 602
			$this->from = $board_contact;
}


			$this->from = $board_contact;
}


		$encode_eol = ($config['smtp_delivery']) ? "\r\n" : PHP_EOL;

		$encode_eol = $config['smtp_delivery'] || PHP_VERSION_ID >= 80000 ? "\r\n" : PHP_EOL;


// Build to, cc and bcc strings
$to = $cc = $bcc = '';


// Build to, cc and bcc strings
$to = $cc = $bcc = '';

Line 629Line 634
			}
else
{

			}
else
{

				$result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, PHP_EOL, $err_msg);

				$result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $encode_eol, $err_msg);

			}

if (!$result)

			}

if (!$result)

Line 691Line 696
		if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

		if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

			$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);

			$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], html_entity_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);


if (!$this->jabber->connect())
{


if (!$this->jabber->connect())
{

Line 891Line 896
					}

include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

					}

include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

					$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);

					$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], html_entity_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);


if (!$this->jabber->connect())
{


if (!$this->jabber->connect())
{

Line 952Line 957
							}
else
{

							}
else
{

								$result = phpbb_mail($to, $subject, $msg, $headers, PHP_EOL, $err_msg);


								$encode_eol = $config['smtp_delivery'] || PHP_VERSION_ID >= 80000 ? "\r\n" : PHP_EOL;
$result = phpbb_mail($to, $subject, $msg, $headers, $encode_eol, $err_msg);

							}

if (!$result)

							}

if (!$result)

Line 1208Line 1214
	}

// Let me in. This function handles the complete authentication process

	}

// Let me in. This function handles the complete authentication process

	if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], htmlspecialchars_decode($config['smtp_password'], ENT_COMPAT), $config['smtp_auth_method']))

	if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], html_entity_decode($config['smtp_password'], ENT_COMPAT), $config['smtp_auth_method']))

	{
$smtp->close_session($err_msg);
return false;

	{
$smtp->close_session($err_msg);
return false;

Line 1882Line 1888
	{
$encoded_char = $is_quoted_printable
? $char = preg_replace_callback(

	{
$encoded_char = $is_quoted_printable
? $char = preg_replace_callback(

				'/[=_\?\x20\x00-\x1F\x80-\xFF]/',

				'/[()<>@,;:\\\\".\[\]=_?\x20\x00-\x1F\x80-\xFF]/',

				function ($matches)
{
$hex = dechex(ord($matches[0]));

				function ($matches)
{
$hex = dechex(ord($matches[0]));