phpBB

Code Changes

File: includes/functions_messenger.php

  Unmodified   Added   Modified   Removed
Line 84Line 84
			return;
}


			return;
}


		$pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0;

		$pos = isset($this->addresses['to']) ? count($this->addresses['to']) : 0;


$this->addresses['to'][$pos]['email'] = trim($address);



$this->addresses['to'][$pos]['email'] = trim($address);


Line 109Line 109
			return;
}


			return;
}


		$pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0;

		$pos = isset($this->addresses['cc']) ? count($this->addresses['cc']) : 0;

		$this->addresses['cc'][$pos]['email'] = trim($address);
$this->addresses['cc'][$pos]['name'] = trim($realname);
}

		$this->addresses['cc'][$pos]['email'] = trim($address);
$this->addresses['cc'][$pos]['name'] = trim($realname);
}

Line 124Line 124
			return;
}


			return;
}


		$pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0;

		$pos = isset($this->addresses['bcc']) ? count($this->addresses['bcc']) : 0;

		$this->addresses['bcc'][$pos]['email'] = trim($address);
$this->addresses['bcc'][$pos]['name'] = trim($realname);
}

		$this->addresses['bcc'][$pos]['email'] = trim($address);
$this->addresses['bcc'][$pos]['name'] = trim($realname);
}

Line 140Line 140
			return;
}


			return;
}


		$pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0;

		$pos = isset($this->addresses['im']) ? count($this->addresses['im']) : 0;

		$this->addresses['im'][$pos]['uid'] = trim($address);
$this->addresses['im'][$pos]['name'] = trim($realname);
}

		$this->addresses['im'][$pos]['uid'] = trim($address);
$this->addresses['im'][$pos]['name'] = trim($realname);
}

Line 416Line 416
		switch ($type)
{
case 'EMAIL':

		switch ($type)
{
case 'EMAIL':

				$message = '<strong>EMAIL/' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP/' . $config['email_function_name'] . '()') . '</strong>';

				$message = '<strong>EMAIL/' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP/mail()') . '</strong>';

			break;

default:

			break;

default:

Line 503Line 503
		$vars = array('headers');
extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars)));


		$vars = array('headers');
extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars)));


		if (sizeof($this->extra_headers))

		if (count($this->extra_headers))

		{
$headers = array_merge($headers, $this->extra_headers);
}

		{
$headers = array_merge($headers, $this->extra_headers);
}

Line 814Line 814
			}

$package_size = $data_ary['package_size'];

			}

$package_size = $data_ary['package_size'];

			$num_items = (!$package_size || sizeof($data_ary['data']) < $package_size) ? sizeof($data_ary['data']) : $package_size;

			$num_items = (!$package_size || count($data_ary['data']) < $package_size) ? count($data_ary['data']) : $package_size;


/*
* This code is commented out because it causes problems on some web hosts.


/*
* This code is commented out because it causes problems on some web hosts.

Line 823Line 823
			* web host and the package size setting is wrong.

// If the amount of emails to be sent is way more than package_size than we need to increase it to prevent backlogs...

			* web host and the package size setting is wrong.

// If the amount of emails to be sent is way more than package_size than we need to increase it to prevent backlogs...

			if (sizeof($data_ary['data']) > $package_size * 2.5)

			if (count($data_ary['data']) > $package_size * 2.5)

			{

			{

				$num_items = sizeof($data_ary['data']);

				$num_items = count($data_ary['data']);

			}
*/


			}
*/


Line 914Line 914
			}

// No more data for this object? Unset it

			}

// No more data for this object? Unset it

			if (!sizeof($this->queue_data[$object]['data']))

			if (!count($this->queue_data[$object]['data']))

			{
unset($this->queue_data[$object]);
}

			{
unset($this->queue_data[$object]);
}

Line 930Line 930
			}
}


			}
}


		if (!sizeof($this->queue_data))

		if (!count($this->queue_data))

		{
@unlink($this->cache_file);
}

		{
@unlink($this->cache_file);
}

Line 965Line 965
	*/
function save()
{

	*/
function save()
{

		if (!sizeof($this->data))

		if (!count($this->data))

		{
return;
}

		{
return;
}

Line 979Line 979

foreach ($this->queue_data as $object => $data_ary)
{


foreach ($this->queue_data as $object => $data_ary)
{

				if (isset($this->data[$object]) && sizeof($this->data[$object]))

				if (isset($this->data[$object]) && count($this->data[$object]))

				{
$this->data[$object]['data'] = array_merge($data_ary['data'], $this->data[$object]['data']);
}

				{
$this->data[$object]['data'] = array_merge($data_ary['data'], $this->data[$object]['data']);
}

Line 1067Line 1067
	$mail_rcpt = $mail_to = $mail_cc = array();

// Build correct addresses for RCPT TO command and the client side display (TO, CC)

	$mail_rcpt = $mail_to = $mail_cc = array();

// Build correct addresses for RCPT TO command and the client side display (TO, CC)

	if (isset($addresses['to']) && sizeof($addresses['to']))

	if (isset($addresses['to']) && count($addresses['to']))

	{
foreach ($addresses['to'] as $which_ary)
{

	{
foreach ($addresses['to'] as $which_ary)
{

Line 1076Line 1076
		}
}


		}
}


	if (isset($addresses['bcc']) && sizeof($addresses['bcc']))

	if (isset($addresses['bcc']) && count($addresses['bcc']))

	{
foreach ($addresses['bcc'] as $which_ary)
{

	{
foreach ($addresses['bcc'] as $which_ary)
{

Line 1084Line 1084
		}
}


		}
}


	if (isset($addresses['cc']) && sizeof($addresses['cc']))

	if (isset($addresses['cc']) && count($addresses['cc']))

	{
foreach ($addresses['cc'] as $which_ary)
{

	{
foreach ($addresses['cc'] as $which_ary)
{

Line 1802Line 1802
	$array = utf8_str_split($str);
$str = '';


	$array = utf8_str_split($str);
$str = '';


	while (sizeof($array))

	while (count($array))

	{
$text = '';


	{
$text = '';


		while (sizeof($array) && intval((strlen($text . $array[0]) + 2) / 3) << 2 <= $split_length)

		while (count($array) && intval((strlen($text . $array[0]) + 2) / 3) << 2 <= $split_length)

		{
$text .= array_shift($array);
}

		{
$text .= array_shift($array);
}

Line 1839Line 1839
	// On some PHP Versions mail() *may* fail if there are newlines within the subject.
// Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8.
// Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used)

	// On some PHP Versions mail() *may* fail if there are newlines within the subject.
// Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8.
// Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used)

	$result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);


	$additional_parameters = $config['email_force_sender'] ? '-f' . $config['board_email'] : '';
$result = mail($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers, $additional_parameters);


$collector->uninstall();
$err_msg = $collector->format_errors();


$collector->uninstall();
$err_msg = $collector->format_errors();