Vergleich inc/functions.php - 1.8.28 - 1.8.35

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 581Zeile 581
			{
require_once MYBB_ROOT . "inc/mailhandlers/php.php";
$my_mailhandler_builtin = new PhpMail();

			{
require_once MYBB_ROOT . "inc/mailhandlers/php.php";
$my_mailhandler_builtin = new PhpMail();

				if(!empty($mybb->settings['mail_parameters']))

				if(!empty($mybb->config['mail_parameters']))

				{

				{

					$my_mailhandler_builtin->additional_parameters = $mybb->settings['mail_parameters'];

					$my_mailhandler_builtin->additional_parameters = $mybb->config['mail_parameters'];

				}
}
}


				}
}
}


		$plugins->run_hooks('my_mailhandler_builtin_after_init', $my_mailhandler_builtin);




		if(isset($plugins) && is_object($plugins))
{
$plugins->run_hooks('my_mailhandler_builtin_after_init', $my_mailhandler_builtin);
}


return $my_mailhandler_builtin;
}


return $my_mailhandler_builtin;
}





	// If our mail handler doesn't exist, create it.
if(!is_object($my_mailhandler))
{
require_once MYBB_ROOT . "inc/class_mailhandler.php";


	// If our mail handler doesn't exist, create it.
if(!is_object($my_mailhandler))
{
require_once MYBB_ROOT . "inc/class_mailhandler.php";


		$plugins->run_hooks('my_mailhandler_init', $my_mailhandler);




		if(isset($plugins) && is_object($plugins))
{
$plugins->run_hooks('my_mailhandler_init', $my_mailhandler);
}


// If no plugin has ever created the mail handler, resort to use the built-in one.
if(!is_object($my_mailhandler) || !($my_mailhandler instanceof MailHandler))


// If no plugin has ever created the mail handler, resort to use the built-in one.
if(!is_object($my_mailhandler) || !($my_mailhandler instanceof MailHandler))

Zeile 663Zeile 669
		'is_mail_sent' => &$is_mail_sent,
'continue_process' => &$continue_process,
);

		'is_mail_sent' => &$is_mail_sent,
'continue_process' => &$continue_process,
);


$plugins->run_hooks('my_mail_pre_build_message', $my_mail_parameters);






if(isset($plugins) && is_object($plugins))
{
$plugins->run_hooks('my_mail_pre_build_message', $my_mail_parameters);
}


	// Build the mail message.
$mail->build_message($to, $subject, $message, $from, $charset, $headers, $format, $message_text, $return_email);


	// Build the mail message.
$mail->build_message($to, $subject, $message, $from, $charset, $headers, $format, $message_text, $return_email);


	$plugins->run_hooks('my_mail_pre_send', $my_mail_parameters);





	if(isset($plugins) && is_object($plugins))
{
$plugins->run_hooks('my_mail_pre_send', $my_mail_parameters);
}


	// Check if the hooked plugins still suggest to send the mail.
if($continue_process)

	// Check if the hooked plugins still suggest to send the mail.
if($continue_process)

	{

	{

		$is_mail_sent = $mail->send();

		$is_mail_sent = $mail->send();

	}

	}





	$plugins->run_hooks('my_mail_post_send', $my_mail_parameters);




	if(isset($plugins) && is_object($plugins))
{
$plugins->run_hooks('my_mail_post_send', $my_mail_parameters);
}


return $is_mail_sent;
}


return $is_mail_sent;
}

Zeile 856Zeile 871
	{
$forum_cache = cache_forums();
foreach($forum_cache as $forum)

	{
$forum_cache = cache_forums();
foreach($forum_cache as $forum)

		{

		{

			if($forum['active'] != 0)
{
$forums_by_parent[$forum['pid']][$forum['fid']] = $forum;

			if($forum['active'] != 0)
{
$forums_by_parent[$forum['pid']][$forum['fid']] = $forum;

Zeile 905Zeile 920
		// Send our headers.
@header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("errors" => array($error)));

		// Send our headers.
@header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("errors" => array($error)));

		exit;
}

		exit;
}


if(!$title)
{
$title = $mybb->settings['bbname'];
}


if(!$title)
{
$title = $mybb->settings['bbname'];
}





	$timenow = my_date('relative', TIME_NOW);
reset_breadcrumb();
add_breadcrumb($lang->error);

	$timenow = my_date('relative', TIME_NOW);
reset_breadcrumb();
add_breadcrumb($lang->error);





	eval("\$errorpage = \"".$templates->get("error")."\";");
output_page($errorpage);

exit;

	eval("\$errorpage = \"".$templates->get("error")."\";");
output_page($errorpage);

exit;

}


}


/**
* Produce an error message for displaying inline on a page
*

/**
* Produce an error message for displaying inline on a page
*

Zeile 938Zeile 953
	if(!$title)
{
$title = $lang->please_correct_errors;

	if(!$title)
{
$title = $lang->please_correct_errors;

	}


	}


	if(!is_array($errors))
{
$errors = array($errors);

	if(!is_array($errors))
{
$errors = array($errors);

Zeile 988Zeile 1003
		"nopermission" => '1',
"location1" => 0,
"location2" => 0

		"nopermission" => '1',
"location1" => 0,
"location2" => 0

	);

	);


$db->update_query("sessions", $noperm_array, "sid='{$session->sid}'");



$db->update_query("sessions", $noperm_array, "sid='{$session->sid}'");


Zeile 1384Zeile 1399

$usergroup = array();
$usergroup['all_usergroups'] = $gid;


$usergroup = array();
$usergroup['all_usergroups'] = $gid;





	// Get those switch permissions from the first valid group.
$permswitches_usergroup = array();
$grouppermswitches = array();

	// Get those switch permissions from the first valid group.
$permswitches_usergroup = array();
$grouppermswitches = array();

Zeile 1396Zeile 1411
			{
$grouppermswitches[] = $perm;
}

			{
$grouppermswitches[] = $perm;
}

		}

		}

		else
{
$grouppermswitches[] = $permvalue;

		else
{
$grouppermswitches[] = $permvalue;

		}

		}

	}
$grouppermswitches = array_unique($grouppermswitches);
foreach($groups as $gid)

	}
$grouppermswitches = array_unique($grouppermswitches);
foreach($groups as $gid)

Zeile 1449Zeile 1464
				}
// Less is more for some numerical group permissions (i.e. post count required for using signature) so take that into account, too.
else if(in_array($perm, $groupzerolesser))

				}
// Less is more for some numerical group permissions (i.e. post count required for using signature) so take that into account, too.
else if(in_array($perm, $groupzerolesser))

				{

				{

					// -1 means a `0 or lesser` permission. Value 0 means unlimited.
$perm_is_numerical = -1;
}

					// -1 means a `0 or lesser` permission. Value 0 means unlimited.
$perm_is_numerical = -1;
}

Zeile 1498Zeile 1513

// Set this permission if not set yet.
if(!isset($usergroup[$perm]))


// Set this permission if not set yet.
if(!isset($usergroup[$perm]))

						{

						{

							$usergroup[$perm] = $access;

							$usergroup[$perm] = $access;

						}

						}


// If current group's setting enables the permission, we may need to update the user's permission.
if($group_current_perm_enabled)


// If current group's setting enables the permission, we may need to update the user's permission.
if($group_current_perm_enabled)

Zeile 1515Zeile 1530
							{
$usergroup[$perm] = $access;
}

							{
$usergroup[$perm] = $access;
}

						}
}

						}
}


// No switch controls this permission, or permission needs an update.
if($update_current_perm)


// No switch controls this permission, or permission needs an update.
if($update_current_perm)

Zeile 1582Zeile 1597

$displaygroup = array();
$group = $groupscache[$gid];


$displaygroup = array();
$group = $groupscache[$gid];





	foreach($displaygroupfields as $field)
{
$displaygroup[$field] = $group[$field];

	foreach($displaygroupfields as $field)
{
$displaygroup[$field] = $group[$field];

Zeile 1631Zeile 1646
	}

if(!is_array($forum_cache))

	}

if(!is_array($forum_cache))

	{
$forum_cache = cache_forums();

	{
$forum_cache = cache_forums();


if(!$forum_cache)
{
return false;
}


if(!$forum_cache)
{
return false;
}

	}

	}


if(!is_array($fpermcache))
{


if(!is_array($fpermcache))
{

Zeile 1648Zeile 1663
	if($fid) // Fetch the permissions for a single forum
{
if(empty($cached_forum_permissions_permissions[$gid][$fid]))

	if($fid) // Fetch the permissions for a single forum
{
if(empty($cached_forum_permissions_permissions[$gid][$fid]))

		{

		{

			$cached_forum_permissions_permissions[$gid][$fid] = fetch_forum_permissions($fid, $gid, $groupperms);
}
return $cached_forum_permissions_permissions[$gid][$fid];

			$cached_forum_permissions_permissions[$gid][$fid] = fetch_forum_permissions($fid, $gid, $groupperms);
}
return $cached_forum_permissions_permissions[$gid][$fid];

Zeile 1658Zeile 1673
		if(empty($cached_forum_permissions[$gid]))
{
foreach($forum_cache as $forum)

		if(empty($cached_forum_permissions[$gid]))
{
foreach($forum_cache as $forum)

			{

			{

				$cached_forum_permissions[$gid][$forum['fid']] = fetch_forum_permissions($forum['fid'], $gid, $groupperms);
}
}

				$cached_forum_permissions[$gid][$forum['fid']] = fetch_forum_permissions($forum['fid'], $gid, $groupperms);
}
}

Zeile 1680Zeile 1695
	global $groupscache, $forum_cache, $fpermcache, $mybb, $fpermfields;

$groups = explode(",", $gid);

	global $groupscache, $forum_cache, $fpermcache, $mybb, $fpermfields;

$groups = explode(",", $gid);


if(empty($fpermcache[$fid])) // This forum has no custom or inherited permissions so lets just return the group permissions
{
return $groupperms;
}









	$current_permissions = array();
$only_view_own_threads = 1;
$only_reply_own_threads = 1;


	$current_permissions = array();
$only_view_own_threads = 1;
$only_reply_own_threads = 1;


	foreach($groups as $gid)





	if(empty($fpermcache[$fid])) // This forum has no custom or inherited permissions so lets just return the group permissions
{
$current_permissions = $groupperms;
}
else

	{

	{

		if(!empty($groupscache[$gid]))

		foreach($groups as $gid)

		{

		{

			$level_permissions = array();

// If our permissions arn't inherited we need to figure them out
if(empty($fpermcache[$fid][$gid]))
{
$parents = explode(',', $forum_cache[$fid]['parentlist']);
rsort($parents);
if(!empty($parents))
{
foreach($parents as $parent_id)
{
if(!empty($fpermcache[$parent_id][$gid]))
{
$level_permissions = $fpermcache[$parent_id][$gid];
break;
}
}
}

			// If this forum has custom or inherited permissions for the currently looped group.
if(!empty($fpermcache[$fid][$gid]))
{
$level_permissions = $fpermcache[$fid][$gid];
}
// Or, use the group permission instead, if available. Some forum permissions not existing here will be added back later.
else if(!empty($groupscache[$gid]))
{
$level_permissions = $groupscache[$gid];










			}

			}

			else


			// No permission is available for the currently looped group, probably we have bad data here.
else

			{

			{

				$level_permissions = $fpermcache[$fid][$gid];
}

// If we STILL don't have forum permissions we use the usergroup itself
if(empty($level_permissions))
{
$level_permissions = $groupscache[$gid];

				continue;







			}

foreach($level_permissions as $permission => $access)

			}

foreach($level_permissions as $permission => $access)

Zeile 1742Zeile 1742
				$only_reply_own_threads = 0;
}
}

				$only_reply_own_threads = 0;
}
}

	}







if(count($current_permissions) == 0)
{
$current_permissions = $groupperms;
}
}


// Figure out if we can view more than our own threads


// Figure out if we can view more than our own threads

	if($only_view_own_threads == 0)
{

	if($only_view_own_threads == 0 || !isset($current_permissions["canonlyviewownthreads"]))
{

		$current_permissions["canonlyviewownthreads"] = 0;

		$current_permissions["canonlyviewownthreads"] = 0;

	}


	}


	// Figure out if we can reply more than our own threads

	// Figure out if we can reply more than our own threads

	if($only_reply_own_threads == 0)

	if($only_reply_own_threads == 0 || !isset($current_permissions["canonlyreplyownthreads"]))

	{
$current_permissions["canonlyreplyownthreads"] = 0;

	{
$current_permissions["canonlyreplyownthreads"] = 0;

	}

	}





	if(count($current_permissions) == 0)
{
$current_permissions = $groupperms;
}

 
	return $current_permissions;
}


	return $current_permissions;
}


Zeile 1890Zeile 1891
	}

if($showform)

	}

if($showform)

	{
if($pid)
{
header("Location: ".$mybb->settings['bburl']."/".get_forum_link($fid));
}
else

	{
if($pid)
{
header("Location: ".$mybb->settings['bburl']."/".get_forum_link($fid));
}
else

		{
$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";");

		{
$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";");

Zeile 2242Zeile 2243
 *
* @param string $name The cookie identifier.
* @param string $value The cookie value.

 *
* @param string $name The cookie identifier.
* @param string $value The cookie value.

 * @param int|string $expires The timestamp of the expiry date.

 * @param int|string $expires The timestamp of the expiry date.

 * @param boolean $httponly True if setting a HttpOnly cookie (supported by the majority of web browsers)
* @param string $samesite The samesite attribute to prevent CSRF.
*/

 * @param boolean $httponly True if setting a HttpOnly cookie (supported by the majority of web browsers)
* @param string $samesite The samesite attribute to prevent CSRF.
*/

Zeile 2283Zeile 2284
	if(!empty($mybb->settings['cookiepath']))
{
$cookie .= "; path={$mybb->settings['cookiepath']}";

	if(!empty($mybb->settings['cookiepath']))
{
$cookie .= "; path={$mybb->settings['cookiepath']}";

	}

	}


if(!empty($mybb->settings['cookiedomain']))
{


if(!empty($mybb->settings['cookiedomain']))
{

Zeile 2308Zeile 2309
	if($mybb->settings['cookiesecureflag'])
{
$cookie .= "; Secure";

	if($mybb->settings['cookiesecureflag'])
{
$cookie .= "; Secure";

	}

$mybb->cookies[$name] = $value;


	}

$mybb->cookies[$name] = $value;


	header($cookie, false);
}


	header($cookie, false);
}


Zeile 2325Zeile 2326
	global $mybb;

$expires = -3600;

	global $mybb;

$expires = -3600;

	my_setcookie($name, "", $expires);

	my_setcookie($name, "", $expires);


unset($mybb->cookies[$name]);
}


unset($mybb->cookies[$name]);
}

Zeile 2346Zeile 2347
		return false;
}


		return false;
}


	$cookie = my_unserialize($mybb->cookies['mybb'][$name]);

	$cookie = my_unserialize($mybb->cookies['mybb'][$name], false);


if(is_array($cookie) && isset($cookie[$id]))
{


if(is_array($cookie) && isset($cookie[$id]))
{

Zeile 2355Zeile 2356
	else
{
return 0;

	else
{
return 0;

	}
}

/**

	}
}

/**

 * Set a serialised cookie array.
*
* @param string $name The cookie identifier.

 * Set a serialised cookie array.
*
* @param string $name The cookie identifier.

Zeile 2372Zeile 2373

if(isset($mybb->cookies['mybb'][$name]))
{


if(isset($mybb->cookies['mybb'][$name]))
{

		$newcookie = my_unserialize($mybb->cookies['mybb'][$name]);

		$newcookie = my_unserialize($mybb->cookies['mybb'][$name], false);

	}
else
{

	}
else
{

Zeile 2382Zeile 2383
	$newcookie[$id] = $value;
$newcookie = my_serialize($newcookie);
my_setcookie("mybb[$name]", addslashes($newcookie), $expires);

	$newcookie[$id] = $value;
$newcookie = my_serialize($newcookie);
my_setcookie("mybb[$name]", addslashes($newcookie), $expires);

 

if(isset($mybb->cookies['mybb']) && !is_array($mybb->cookies['mybb']))
{
$mybb->cookies['mybb'] = array();
}


// Make sure our current viarables are up-to-date as well
$mybb->cookies['mybb'][$name] = $newcookie;


// Make sure our current viarables are up-to-date as well
$mybb->cookies['mybb'][$name] = $newcookie;

Zeile 2401Zeile 2407
 * - does not unserialize objects
*
* @param string $str

 * - does not unserialize objects
*
* @param string $str

 
 * @param bool $unlimited Whether to apply limits defined in MAX_SERIALIZED_* constants

 * @return mixed
* @throw Exception if $str is malformed or contains unsupported types (e.g., resources, objects)
*/

 * @return mixed
* @throw Exception if $str is malformed or contains unsupported types (e.g., resources, objects)
*/

function _safe_unserialize($str)

function _safe_unserialize($str, $unlimited = true)

{

{

	if(strlen($str) > MAX_SERIALIZED_INPUT_LENGTH)

	if(!$unlimited && strlen($str) > MAX_SERIALIZED_INPUT_LENGTH)

	{
// input exceeds MAX_SERIALIZED_INPUT_LENGTH
return false;

	{
// input exceeds MAX_SERIALIZED_INPUT_LENGTH
return false;

Zeile 2434Zeile 2441
		if($type == '}')
{
$str = substr($str, 1);

		if($type == '}')
{
$str = substr($str, 1);

		}

		}

		else if($type == 'N' && $str[1] == ';')

		else if($type == 'N' && $str[1] == ';')

		{

		{

			$value = null;
$str = substr($str, 2);
}
else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))

			$value = null;
$str = substr($str, 2);
}
else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))

		{

		{

			$value = $matches[1] == '1' ? true : false;
$str = substr($str, 4);
}
else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
{
$value = (int)$matches[1];

			$value = $matches[1] == '1' ? true : false;
$str = substr($str, 4);
}
else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
{
$value = (int)$matches[1];

			$str = $matches[2];

			$str = $matches[2];

		}
else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
{
$value = (float)$matches[1];
$str = $matches[3];

		}
else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
{
$value = (float)$matches[1];
$str = $matches[3];

		}

		}

		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')

		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')

		{

		{

			$value = substr($matches[2], 0, (int)$matches[1]);
$str = substr($matches[2], (int)$matches[1] + 2);
}

			$value = substr($matches[2], 0, (int)$matches[1]);
$str = substr($matches[2], (int)$matches[1] + 2);
}

		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches) && $matches[1] < MAX_SERIALIZED_ARRAY_LENGTH)





		else if(
$type == 'a' &&
preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches) &&
($unlimited || $matches[1] < MAX_SERIALIZED_ARRAY_LENGTH)
)

		{
$expectedLength = (int)$matches[1];
$str = $matches[2];

		{
$expectedLength = (int)$matches[1];
$str = $matches[2];

		}

		}

		else

		else

		{

		{

			// object or unknown/malformed type
return false;
}

			// object or unknown/malformed type
return false;
}

Zeile 2474Zeile 2485
		switch($state)
{
case 3: // in array, expecting value or another array

		switch($state)
{
case 3: // in array, expecting value or another array

				if($type == 'a')
{
if(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)
{
// array nesting exceeds MAX_SERIALIZED_ARRAY_DEPTH
return false;

				if($type == 'a')
{
if(!$unlimited && count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)
{
// array nesting exceeds MAX_SERIALIZED_ARRAY_DEPTH
return false;

					}

$stack[] = &$list;

					}

$stack[] = &$list;

Zeile 2493Zeile 2504
				{
$list[$key] = $value;
$state = 2;

				{
$list[$key] = $value;
$state = 2;

					break;
}

					break;
}


// missing array value
return false;


// missing array value
return false;

Zeile 2521Zeile 2532
				}
if($type == 'i' || $type == 's')
{

				}
if($type == 'i' || $type == 's')
{

					if(count($list) >= MAX_SERIALIZED_ARRAY_LENGTH)

					if(!$unlimited && count($list) >= MAX_SERIALIZED_ARRAY_LENGTH)

					{
// array size exceeds MAX_SERIALIZED_ARRAY_LENGTH

					{
// array size exceeds MAX_SERIALIZED_ARRAY_LENGTH

						return false;

						return false;

					}
if(count($list) >= end($expected))
{
// array size exceeds expected length
return false;
}

					}
if(count($list) >= end($expected))
{
// array size exceeds expected length
return false;
}





					$key = $value;
$state = 3;
break;
}

// illegal array index type

					$key = $value;
$state = 3;
break;
}

// illegal array index type

				return false;

				return false;


case 0: // expecting array or value
if($type == 'a')
{


case 0: // expecting array or value
if($type == 'a')
{

					if(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)

					if(!$unlimited && count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)

					{
// array nesting exceeds MAX_SERIALIZED_ARRAY_DEPTH
return false;

					{
// array nesting exceeds MAX_SERIALIZED_ARRAY_DEPTH
return false;

Zeile 2553Zeile 2564
					$list = &$data;
$expected[] = $expectedLength;
$state = 2;

					$list = &$data;
$expected[] = $expectedLength;
$state = 2;

					break;

					break;

				}
if($type != '}')
{

				}
if($type != '}')
{

Zeile 2561Zeile 2572
					$state = 1;
break;
}

					$state = 1;
break;
}





				// not in array
return false;
}
}

if(!empty($str))

				// not in array
return false;
}
}

if(!empty($str))

	{

	{

		// trailing data in input
return false;

		// trailing data in input
return false;

	}

	}

	return $data;
}

/**

	return $data;
}

/**

 * Credits go to https://github.com/piwik
* Wrapper for _safe_unserialize() that handles exceptions and multibyte encoding issue




























 * Credits go to https://github.com/piwik
* Wrapper for _safe_unserialize() that handles exceptions and multibyte encoding issue
*
* @param string $str
* @param bool $unlimited
* @return mixed
*/
function my_unserialize($str, $unlimited = true)
{
// Ensure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
if(function_exists('mb_internal_encoding') && (((int)ini_get('mbstring.func_overload')) & 2))
{
$mbIntEnc = mb_internal_encoding();
mb_internal_encoding('ASCII');
}

$out = _safe_unserialize($str, $unlimited);

if(isset($mbIntEnc))
{
mb_internal_encoding($mbIntEnc);
}

return $out;
}

/**
* Unserializes data using PHP's `unserialize()`, and its safety options if possible.
* This function should only be used for values from trusted sources.

 *
* @param string $str
* @return mixed
*/

 *
* @param string $str
* @return mixed
*/

function my_unserialize($str)

function native_unserialize($str)

{

{

	// Ensure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
if(function_exists('mb_internal_encoding') && (((int)ini_get('mbstring.func_overload')) & 2))
{
$mbIntEnc = mb_internal_encoding();
mb_internal_encoding('ASCII');
}

$out = _safe_unserialize($str);

if(isset($mbIntEnc))

	if(version_compare(PHP_VERSION, '7.0.0', '>='))










	{

	{

		mb_internal_encoding($mbIntEnc);





		return unserialize($str, array('allowed_classes' => false));
}
else
{
return unserialize($str);

	}

	}


return $out;

 
}

/**

}

/**

Zeile 6948Zeile 6979
	$query = $db->simple_select("users", "COUNT(email) as emails", "email = '".$db->escape_string($email)."'{$uid_string}");

if($db->fetch_field($query, "emails") > 0)

	$query = $db->simple_select("users", "COUNT(email) as emails", "email = '".$db->escape_string($email)."'{$uid_string}");

if($db->fetch_field($query, "emails") > 0)

	{
return true;
}

	{
return true;
}


return false;
}


return false;
}

Zeile 7091Zeile 7122
		}

// Now make PREG compatible

		}

// Now make PREG compatible

		$find = "#(?!<.*?)(".preg_quote($word, "#").")(?![^<>]*?>)#ui";
$replacement = "<span class=\"highlight\" style=\"padding-left: 0px; padding-right: 0px;\">$1</span>";

		$find = "/(?<!&|&#)\b([[:alnum:]]*)(".preg_quote($word, "/").")(?![^<>]*?>)/ui";
$replacement = "$1<span class=\"highlight\" style=\"padding-left: 0px; padding-right: 0px;\">$2</span>";

		$highlight_cache[$find] = $replacement;
}


		$highlight_cache[$find] = $replacement;
}


Zeile 9019Zeile 9050
		}
}


		}
}


	if(!$pm['subject'] ||!$pm['message'] || !$pm['touid'] || (!$pm['receivepms'] && !$admin_override))

	if(empty($pm['subject']) || empty($pm['message']) || empty($pm['touid']) || (empty($pm['receivepms']) && !$admin_override))

	{
return false;
}

	{
return false;
}

Zeile 9043Zeile 9074
	}

$recipients_bcc = array();

	}

$recipients_bcc = array();

 

// Workaround for eliminating PHP warnings in PHP 8. Ref: https://github.com/mybb/mybb/issues/4630#issuecomment-1369144163
if(isset($pm['sender']['uid']) && $pm['sender']['uid'] === -1 && $fromid === -1)
{
$sender = array(
"uid" => 0,
"username" => ''
);
}


// Determine user ID
if((int)$fromid == 0)


// Determine user ID
if((int)$fromid == 0)

	{

	{

		$fromid = (int)$mybb->user['uid'];
}
elseif((int)$fromid < 0)

		$fromid = (int)$mybb->user['uid'];
}
elseif((int)$fromid < 0)

Zeile 9065Zeile 9105
		"do" => '',
"pmid" => ''
);

		"do" => '',
"pmid" => ''
);

 

// (continued) Workaround for eliminating PHP warnings in PHP 8. Ref: https://github.com/mybb/mybb/issues/4630#issuecomment-1369144163
if(isset($sender))
{
$pm['sender'] = $sender;
}


if(isset($session))
{


if(isset($session))
{