Vergleich inc/functions.php - 1.6.16 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1329Zeile 1329
/**
* Check the password given on a certain forum for validity
*

/**
* Check the password given on a certain forum for validity
*

 * @param int The forum ID
* @param boolean The Parent ID



 * @param int $fid The forum ID
* @param int $pid The Parent ID
* @param bool $return
* @return bool

 */

 */

function check_forum_password($fid, $pid=0)

function check_forum_password($fid, $pid=0, $return=false)

{
global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;

{
global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;





	$showform = true;

if(!is_array($forum_cache))

	$showform = true;

if(!is_array($forum_cache))

	{

	{

		$forum_cache = cache_forums();
if(!$forum_cache)
{

		$forum_cache = cache_forums();
if(!$forum_cache)
{

Zeile 1355Zeile 1357
		foreach($parents as $parent_id)
{
if($parent_id == $fid || $parent_id == $pid)

		foreach($parents as $parent_id)
{
if($parent_id == $fid || $parent_id == $pid)

			{

			{

				continue;

				continue;

			}

			}


if($forum_cache[$parent_id]['password'] != "")
{
check_forum_password($parent_id, $fid);


if($forum_cache[$parent_id]['password'] != "")
{
check_forum_password($parent_id, $fid);

			}
}

			}
}

	}

$password = $forum_cache[$fid]['password'];

	}

$password = $forum_cache[$fid]['password'];

Zeile 1372Zeile 1374
		if($mybb->input['pwverify'] && $pid == 0)
{
if($password == $mybb->input['pwverify'])

		if($mybb->input['pwverify'] && $pid == 0)
{
if($password == $mybb->input['pwverify'])

			{

			{

				my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);
$showform = false;

				my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);
$showform = false;

			}

			}

			else
{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");

			else
{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");

				$showform = true;
}

				$showform = true;
}

		}
else
{

		}
else
{

Zeile 1397Zeile 1399
	else
{
$showform = false;

	else
{
$showform = false;

 
	}

if($return)
{
return $showform;

	}

if($showform)

	}

if($showform)

Zeile 3152Zeile 3159
		{
$icon = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);
}

		{
$icon = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);
}

 
		$icon = htmlspecialchars_uni($icon);

		return "<img src=\"{$icon}\" border=\"0\" alt=\".{$ext}\" />";
}
else

		return "<img src=\"{$icon}\" border=\"0\" alt=\".{$ext}\" />";
}
else

Zeile 3163Zeile 3171
		else if(defined("IN_PORTAL"))
{
global $change_dir;

		else if(defined("IN_PORTAL"))
{
global $change_dir;

			$theme['imgdir'] = "{$change_dir}/images";

			$theme['imgdir'] = htmlspecialchars_uni("{$change_dir}/images");

		}

return "<img src=\"{$theme['imgdir']}/attachtypes/unknown.gif\" border=\"0\" alt=\".{$ext}\" />";

		}

return "<img src=\"{$theme['imgdir']}/attachtypes/unknown.gif\" border=\"0\" alt=\".{$ext}\" />";

Zeile 6390Zeile 6398
}

/**

}

/**

 * More robust version of PHP's trim() function. It includes a list of UTF-16 blank characters

 * More robust version of PHP's trim() function. It includes a list of UTF-8 blank characters

 * from http://kb.mozillazine.org/Network.IDN.blacklist_chars
*
* @param string The string to trim from

 * from http://kb.mozillazine.org/Network.IDN.blacklist_chars
*
* @param string The string to trim from

Zeile 6400Zeile 6408
function trim_blank_chrs($string, $charlist=false)
{
$hex_chrs = array(

function trim_blank_chrs($string, $charlist=false)
{
$hex_chrs = array(

		0x20 => 1,
0x09 => 1,
0x0A => 1,
0x0D => 1,
0x0B => 1,
0xAD => 1,
0xA0 => 1,
0xAD => 1,
0xBF => 1,
0x81 => 1,
0x8D => 1,
0x90 => 1,
0x9D => 1,
0xCC => array(0xB7 => 1, 0xB8 => 1), // \x{0337} or \x{0338}
0xE1 => array(0x85 => array(0x9F => 1, 0xA0 => 1)), // \x{115F} or \x{1160}
0xE2 => array(0x80 => array(0x80 => 1, 0x81 => 1, 0x82 => 1, 0x83 => 1, 0x84 => 1, 0x85 => 1, 0x86 => 1, 0x87 => 1, 0x88 => 1, 0x89 => 1, 0x8A => 1, 0x8B => 1, // \x{2000} to \x{200B}
0xA8 => 1, 0xA9 => 1, 0xAA => 1, 0xAB => 1, 0xAC => 1, 0xAD => 1, 0xAE => 1, 0xAF => 1), // \x{2028} to \x{202F}
0x81 => array(0x9F => 1)), // \x{205F}

		0x09 => 1, // \x{0009}
0x0A => 1, // \x{000A}
0x0B => 1, // \x{000B}
0x0D => 1, // \x{000D}
0x20 => 1, // \x{0020}
0xC2 => array(0x81 => 1, 0x8D => 1, 0x90 => 1, 0x9D => 1, 0xA0 => 1, 0xAD => 1), // \x{0081}, \x{008D}, \x{0090}, \x{009D}, \x{00A0}, \x{00AD}
0xCC => array(0xB7 => 1, 0xB8 => 1), // \x{0337}, \x{0338}
0xE1 => array(0x85 => array(0x9F => 1, 0xA0 => 1), 0x9A => array(0x80 => 1), 0xA0 => array(0x8E => 1)), // \x{115F}, \x{1160}, \x{1680}, \x{180E}
0xE2 => array(0x80 => array(0x80 => 1, 0x81 => 1, 0x82 => 1, 0x83 => 1, 0x84 => 1, 0x85 => 1, 0x86 => 1, 0x87 => 1, 0x88 => 1, 0x89 => 1, 0x8A => 1, 0x8B => 1, 0x8C => 1, 0x8D => 1, 0x8E => 1, 0x8F => 1, // \x{2000} - \x{200F}
0xA8 => 1, 0xA9 => 1, 0xAA => 1, 0xAB => 1, 0xAC => 1, 0xAD => 1, 0xAE => 1, 0xAF => 1), // \x{2028} - \x{202F}
0x81 => array(0x9F => 1)), // \x{205F}








		0xE3 => array(0x80 => array(0x80 => 1), // \x{3000}

		0xE3 => array(0x80 => array(0x80 => 1), // \x{3000}

					  0x85 => array(0xA4 => 1)), // \x{3164}

			0x85 => array(0xA4 => 1)), // \x{3164}

		0xEF => array(0xBB => array(0xBF => 1), // \x{FEFF}

		0xEF => array(0xBB => array(0xBF => 1), // \x{FEFF}

					  0xBE => array(0xA0 => 1), // \x{FFA0}
0xBF => array(0xB9 => 1, 0xBA => 1, 0xBB => 1)), // \x{FFF9} to \x{FFFB}

			0xBE => array(0xA0 => 1), // \x{FFA0}
0xBF => array(0xB9 => 1, 0xBA => 1, 0xBB => 1)), // \x{FFF9} - \x{FFFB}

	);

$hex_chrs_rev = array(

	);

$hex_chrs_rev = array(

		0x20 => 1,
0x09 => 1,
0x0A => 1,
0x0D => 1,
0x0B => 1,
0xA0 => array(0xC2 => 1),
0xAD => array(0xC2 => 1),
0xBF => array(0xC2 => 1),
0x81 => array(0xC2 => 1),
0x8D => array(0xC2 => 1),
0x90 => array(0xC2 => 1),
0x9D => array(0xC2 => 1),

		0x09 => 1, // \x{0009}
0x0A => 1, // \x{000A}
0x0B => 1, // \x{000B}
0x0D => 1, // \x{000D}
0x20 => 1, // \x{0020}
0x81 => array(0xC2 => 1, 0x80 => array(0xE2 => 1)), // \x{0081}, \x{2001}
0x8D => array(0xC2 => 1, 0x80 => array(0xE2 => 1)), // \x{008D}, \x{200D}
0x90 => array(0xC2 => 1), // \x{0090}
0x9D => array(0xC2 => 1), // \x{009D}
0xA0 => array(0xC2 => 1, 0x85 => array(0xE1 => 1), 0x81 => array(0xE2 => 1), 0xBE => array(0xEF => 1)), // \x{00A0}, \x{1160}, \x{2060}, \x{FFA0}
0xAD => array(0xC2 => 1, 0x80 => array(0xE2 => 1)), // \x{00AD}, \x{202D}


		0xB8 => array(0xCC => 1), // \x{0338}
0xB7 => array(0xCC => 1), // \x{0337}

		0xB8 => array(0xCC => 1), // \x{0338}
0xB7 => array(0xCC => 1), // \x{0337}

		0xA0 => array(0x85 => array(0xE1 => 1)), // \x{1160}
0x9F => array(0x85 => array(0xE1 => 1), // \x{115F}
0x81 => array(0xE2 => 1)), // \x{205F}
0x80 => array(0x80 => array(0xE3 => 1, 0xE2 => 1)), // \x{3000}, \x{2000}
0x81 => array(0x80 => array(0xE2 => 1)), // \x{2001}

		0x9F => array(0x85 => array(0xE1 => 1), 0x81 => array(0xE2 => 1)), // \x{115F}, \x{205F}
0x80 => array(0x9A => array(0xE1 => 1), 0x80 => array(0xE2 => 1, 0xE3 => 1)), // \x{1680}, \x{2000}, \x{3000}
0x8E => array(0xA0 => array(0xE1 => 1), 0x80 => array(0xE2 => 1)), // \x{180E}, \x{200E}



		0x82 => array(0x80 => array(0xE2 => 1)), // \x{2002}
0x83 => array(0x80 => array(0xE2 => 1)), // \x{2003}
0x84 => array(0x80 => array(0xE2 => 1)), // \x{2004}

		0x82 => array(0x80 => array(0xE2 => 1)), // \x{2002}
0x83 => array(0x80 => array(0xE2 => 1)), // \x{2003}
0x84 => array(0x80 => array(0xE2 => 1)), // \x{2004}

Zeile 6455Zeile 6453
		0x89 => array(0x80 => array(0xE2 => 1)), // \x{2009}
0x8A => array(0x80 => array(0xE2 => 1)), // \x{200A}
0x8B => array(0x80 => array(0xE2 => 1)), // \x{200B}

		0x89 => array(0x80 => array(0xE2 => 1)), // \x{2009}
0x8A => array(0x80 => array(0xE2 => 1)), // \x{200A}
0x8B => array(0x80 => array(0xE2 => 1)), // \x{200B}

 
		0x8C => array(0x80 => array(0xE2 => 1)), // \x{200C}
0x8F => array(0x80 => array(0xE2 => 1)), // \x{200F}

		0xA8 => array(0x80 => array(0xE2 => 1)), // \x{2028}
0xA9 => array(0x80 => array(0xE2 => 1)), // \x{2029}
0xAA => array(0x80 => array(0xE2 => 1)), // \x{202A}
0xAB => array(0x80 => array(0xE2 => 1)), // \x{202B}
0xAC => array(0x80 => array(0xE2 => 1)), // \x{202C}

		0xA8 => array(0x80 => array(0xE2 => 1)), // \x{2028}
0xA9 => array(0x80 => array(0xE2 => 1)), // \x{2029}
0xAA => array(0x80 => array(0xE2 => 1)), // \x{202A}
0xAB => array(0x80 => array(0xE2 => 1)), // \x{202B}
0xAC => array(0x80 => array(0xE2 => 1)), // \x{202C}

		0xAD => array(0x80 => array(0xE2 => 1)), // \x{202D}

 
		0xAE => array(0x80 => array(0xE2 => 1)), // \x{202E}
0xAF => array(0x80 => array(0xE2 => 1)), // \x{202F}
0xA4 => array(0x85 => array(0xE3 => 1)), // \x{3164}
0xBF => array(0xBB => array(0xEF => 1)), // \x{FEFF}

		0xAE => array(0x80 => array(0xE2 => 1)), // \x{202E}
0xAF => array(0x80 => array(0xE2 => 1)), // \x{202F}
0xA4 => array(0x85 => array(0xE3 => 1)), // \x{3164}
0xBF => array(0xBB => array(0xEF => 1)), // \x{FEFF}

		0xA0 => array(0xBE => array(0xEF => 1)), // \x{FFA0}

 
		0xB9 => array(0xBF => array(0xEF => 1)), // \x{FFF9}
0xBA => array(0xBF => array(0xEF => 1)), // \x{FFFA}
0xBB => array(0xBF => array(0xEF => 1)), // \x{FFFB}

		0xB9 => array(0xBF => array(0xEF => 1)), // \x{FFF9}
0xBA => array(0xBF => array(0xEF => 1)), // \x{FFFA}
0xBB => array(0xBF => array(0xEF => 1)), // \x{FFFB}

Zeile 6474Zeile 6472
	// Start from the beginning and work our way in
do
{

	// Start from the beginning and work our way in
do
{

		// Check to see if we have matched a first character in our utf-16 array

		// Check to see if we have matched a first character in our utf-8 array

		$offset = match_sequence($string, $hex_chrs);
if(!$offset)
{

		$offset = match_sequence($string, $hex_chrs);
if(!$offset)
{

Zeile 6489Zeile 6487
	$string = strrev($string);
do
{

	$string = strrev($string);
do
{

		// Check to see if we have matched a first character in our utf-16 array

		// Check to see if we have matched a first character in our utf-8 array

		$offset = match_sequence($string, $hex_chrs_rev);
if(!$offset)
{

		$offset = match_sequence($string, $hex_chrs_rev);
if(!$offset)
{