Vergleich inc/functions.php - 1.2.8 - 1.2.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * $Id: functions.php 3177 2007-06-29 07:51:12Z chris $

 * $Id: functions.php 3508 2007-11-23 16:10:16Z Tikitiki $

 */

/**

 */

/**

Zeile 18Zeile 18
{
global $db, $lang, $theme, $plugins, $mybb;
global $querytime, $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;

{
global $db, $lang, $theme, $plugins, $mybb;
global $querytime, $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;



 
	$contents = parse_page($contents);
$totaltime = $maintimer->stop();
if($mybb->usergroup['cancp'] == "yes")

	$contents = parse_page($contents);
$totaltime = $maintimer->stop();
if($mybb->usergroup['cancp'] == "yes")

Zeile 32Zeile 31
		if(strstr(getenv("REQUEST_URI"), "?"))
{
$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "&debug=1";

		if(strstr(getenv("REQUEST_URI"), "?"))
{
$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "&debug=1";

		}

		}

		else

		else

		{

		{

			$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "?debug=1";
}
if($mybb->settings['gzipoutput'] != "no")

			$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "?debug=1";
}
if($mybb->settings['gzipoutput'] != "no")

		{

		{

			$gzipen = "Enabled";
}
else

			$gzipen = "Enabled";
}
else

Zeile 58Zeile 57
		if(isset($mybb->input['debug']))
{
debug_page();

		if(isset($mybb->input['debug']))
{
debug_page();

		}

		}

	}
$contents = str_replace("<debugstuff>", "", $contents);
$contents = $plugins->run_hooks("pre_output_page", $contents);

	}
$contents = str_replace("<debugstuff>", "", $contents);
$contents = $plugins->run_hooks("pre_output_page", $contents);

Zeile 72Zeile 71
		else
{
$contents = gzip_encode($contents);

		else
{
$contents = gzip_encode($contents);

		}
}

header("Content-type: text/html; charset={$lang->settings['charset']}");

echo $contents;

		}
}

@header("Content-type: text/html; charset={$lang->settings['charset']}");

echo $contents;


$plugins->run_hooks("post_output_page");



$plugins->run_hooks("post_output_page");


Zeile 222Zeile 221
	{
$contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents;
}

	{
$contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents;
}

 
	
$contents = str_replace("<html", "<html xmlns=\"http://www.w3.org/1999/xhtml\"", $contents);


	if($lang->settings['rtl'] == 1)
{
$contents = str_replace("<html", "<html dir=\"rtl\"", $contents);
}
if($lang->settings['htmllang'])
{

	if($lang->settings['rtl'] == 1)
{
$contents = str_replace("<html", "<html dir=\"rtl\"", $contents);
}
if($lang->settings['htmllang'])
{

		$contents = str_replace("<html", "<html lang=\"".$lang->settings['htmllang']."\"", $contents);

		$contents = str_replace("<html", "<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\"", $contents);

	}

if($loadpmpopup)

	}

if($loadpmpopup)

Zeile 314Zeile 316

/**
* Sends an email using PHP's mail function, formatting it appropriately.


/**
* Sends an email using PHP's mail function, formatting it appropriately.

 *

 *

 * @param string Address the email should be addressed to.
* @param string The subject of the email being sent.
* @param string The message being sent.

 * @param string Address the email should be addressed to.
* @param string The subject of the email being sent.
* @param string The message being sent.

Zeile 328Zeile 330
	if(empty($charset))
{
$charset = $lang->settings['charset'];

	if(empty($charset))
{
$charset = $lang->settings['charset'];

	}


	}


	// Build mail headers
if(my_strlen(trim($from)) == 0)
{

	// Build mail headers
if(my_strlen(trim($from)) == 0)
{

Zeile 344Zeile 346
	else if($_SERVER['HTTP_HOST'])
{
$http_host = $_SERVER['HTTP_HOST'];

	else if($_SERVER['HTTP_HOST'])
{
$http_host = $_SERVER['HTTP_HOST'];

	}

	}

	else
{
$http_host = "unknown.local";

	else
{
$http_host = "unknown.local";

Zeile 356Zeile 358
	$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: MyBB\n";

	$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: MyBB\n";

 
	if(defined("IN_ADMINCP"))
{
$_SERVER['PHP_SELF'] = str_replace($mybb->config['admin_dir']."/", "admin-", $_SERVER['PHP_SELF']);
}

	$headers .= "X-MyBB-Script: {$http_host}{$_SERVER['PHP_SELF']}\n";

// For some reason sendmail/qmail doesn't like \r\n

	$headers .= "X-MyBB-Script: {$http_host}{$_SERVER['PHP_SELF']}\n";

// For some reason sendmail/qmail doesn't like \r\n

Zeile 372Zeile 378
	}

mail($to, $subject, $message, $headers);

	}

mail($to, $subject, $message, $headers);

}


}


/**
* Return a parent list for the specified forum.
*

/**
* Return a parent list for the specified forum.
*

Zeile 490Zeile 496
function inline_error($errors, $title="")
{
global $theme, $mybb, $db, $lang, $templates;

function inline_error($errors, $title="")
{
global $theme, $mybb, $db, $lang, $templates;

	if(!$title)

	if(!$title)

	{
$title = $lang->please_correct_errors;
}

	{
$title = $lang->please_correct_errors;
}

Zeile 520Zeile 526
		"location1" => 0,
"location2" => 0
);

		"location1" => 0,
"location2" => 0
);

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

	$db->update_query(TABLE_PREFIX."sessions", $noperm_array, "sid='".$session->sid."'", 1);

	$url = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
if($mybb->user['uid'])
{

	$url = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
if($mybb->user['uid'])
{

Zeile 645Zeile 651
	global $mybb, $cache, $groupscache, $user_cache;

// If no user id is specified, assume it is the current user

	global $mybb, $cache, $groupscache, $user_cache;

// If no user id is specified, assume it is the current user

	if($uid == 0)
{
$uid = $mybb->user['uid'];
}


	if($uid == 0)
{
$uid = $mybb->user['uid'];
}


	// User id does not match current user, fetch permissions
if($uid != $mybb->user['uid'])
{

	// User id does not match current user, fetch permissions
if($uid != $mybb->user['uid'])
{

Zeile 722Zeile 728
				{
$permbit = "";
}

				{
$permbit = "";
}

				$zerogreater = 0;



				if(in_array($perm, $groupzerogreater))
{
if($access == 0)
{
$usergroup[$perm] = 0;

				if(in_array($perm, $groupzerogreater))
{
if($access == 0)
{
$usergroup[$perm] = 0;

 
						continue;

					}

					}

					$zerogreater = 1;

 
				}

				}

				if(($access > $permbit || ($access == "yes" && $permbit == "no") || !$permbit) && $zerogreater != 1)



if($access > $permbit || ($access == "yes" && $permbit == "no") || !$permbit)

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

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

	}

	}

	return $usergroup;
}


	return $usergroup;
}


Zeile 758Zeile 765
	$displaygroup = array();
$group = $groupscache[$gid];
foreach($displaygroupfields as $field)

	$displaygroup = array();
$group = $groupscache[$gid];
foreach($displaygroupfields as $field)

	{

	{

		$displaygroup[$field] = $group[$field];
}
return $displaygroup;

		$displaygroup[$field] = $group[$field];
}
return $displaygroup;

Zeile 863Zeile 870
		{
// If this forum has permissions set
if($fpermcache[$fid][$gid])

		{
// If this forum has permissions set
if($fpermcache[$fid][$gid])

			{

			{

				$level_permissions = $fpermcache[$fid][$gid];
foreach($level_permissions as $permission => $access)
{

				$level_permissions = $fpermcache[$fid][$gid];
foreach($level_permissions as $permission => $access)
{

Zeile 887Zeile 894
 * Check the password given on a certain forum for validity
*
* @param int The forum ID

 * Check the password given on a certain forum for validity
*
* @param int The forum ID

 * @param string The plain text password for the forum

 * @param boolean The Parent ID

 */

 */

function check_forum_password($fid, $password="")

function check_forum_password($fid, $pid=0)

{

{

	global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang;
$showform = 1;
































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

$showform = true;

if(!is_array($forum_cache))
{
$forum_cache = cache_forums();
if(!$forum_cache)
{
return false;
}
}

// Loop through each of parent forums to ensure we have a password for them too
$parents = explode(',', $forum_cache[$fid]['parentlist']);
rsort($parents);
if(!empty($parents))
{
foreach($parents as $parent_id)
{
if($parent_id == $fid || $parent_id == $pid)
{
continue;
}

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

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

	if($password)
{
if($mybb->input['pwverify'])

	if($password)
{
if($mybb->input['pwverify'])

Zeile 901Zeile 938
			if($password == $mybb->input['pwverify'])
{
my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);

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

				$showform = 0;

				$showform = false;

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

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

				$showform = 1;
}
}

				$showform = true;
}
}

		else
{
if(!$_COOKIE['forumpass'][$fid] || ($_COOKIE['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $_COOKIE['forumpass'][$fid]))
{

		else
{
if(!$_COOKIE['forumpass'][$fid] || ($_COOKIE['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $_COOKIE['forumpass'][$fid]))
{

				$showform = 1;

				$showform = true;

			}
else
{

			}
else
{

				$showform = 0;

				$showform = false;

			}
}
}
else
{

			}
}
}
else
{

		$showform = 0;

		$showform = false;

	}

	}

 


	if($showform)
{
$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);

	if($showform)
{
$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);

Zeile 1205Zeile 1243
		}
if(!$serverload)
{

		}
if(!$serverload)
{

 
			// Suhosin likes to throw a warning if exec is disabled then die - weird
if($func_blacklist = @ini_get('suhosin.executor.func.blacklist'))
{
if(strpos(",".$func_blacklist.",", 'exec') !== false)
{
return $lang->unknown;
}
}
// PHP disabled functions?
if($func_blacklist = @ini_get('disabled_functions'))
{
if(strpos(",".$func_blacklist.",", 'exec') !== false)
{
return $lang->unknown;
}
}

			$load = @exec("uptime");
$load = split("load averages?: ", $load);
$serverload = explode(",", $load[1]);

			$load = @exec("uptime");
$load = split("load averages?: ", $load);
$serverload = explode(",", $load[1]);

Zeile 1213Zeile 1267
				return $lang->unknown;
}
}

				return $lang->unknown;
}
}

	}
else if(class_exists('COM'))
{
$wmi = new COM("WinMgmts:\\\\.");
$cpus = $wmi->InstancesOf("Win32_Processor");

$cpu_count = 0;

if(version_compare(PHP_VERSION, '5.0.0', '>='))
{
// PHP 5
foreach($cpus as $cpu)
{
$serverload[0] += $cpu->LoadPercentage;
++$cpu_count;
}
}
else
{
// PHP 4
while ($cpu = $cpus->Next())
{
$serverload[0] += $cpu->LoadPercentage;
++$cpu_count;
}
}

if($cpu_count > 1)
{
$serverload[0] = round($serverload[0] / $cpu_count, 2);
}
$serverload[0] .= "%";

 
	}
else
{
return $lang->unknown;
}

	}
else
{
return $lang->unknown;
}





	$returnload = trim($serverload[0]);

return $returnload;

	$returnload = trim($serverload[0]);

return $returnload;

}


/**

}


/**

 * Updates the forum statistics with specific values (or addition/subtraction of the previous value)
*

 * Updates the forum statistics with specific values (or addition/subtraction of the previous value)
*

 * @param array Array of items being updated (numthreads,numposts,numusers)

 * @param array Array of items being updated (numthreads,numposts,numusers,lastuser)

 */
function update_stats($changes=array())
{

 */
function update_stats($changes=array())
{

Zeile 1268Zeile 1290

$stats = $cache->read("stats");



$stats = $cache->read("stats");


	$counters = array('numthreads','numposts','numusers');

	$counters = array('numthreads', 'numposts', 'numusers');

	$update = array();
foreach($counters as $counter)
{

	$update = array();
foreach($counters as $counter)
{

Zeile 1278Zeile 1300
			if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
$new_stats[$counter] = $stats[$counter] + $changes[$counter];

			if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
$new_stats[$counter] = $stats[$counter] + $changes[$counter];

			}

			}

			else
{
$new_stats[$counter] = $changes[$counter];

			else
{
$new_stats[$counter] = $changes[$counter];

Zeile 1287Zeile 1309
			if($new_stats[$counter] < 0)
{
$new_stats[$counter] = 0;

			if($new_stats[$counter] < 0)
{
$new_stats[$counter] = 0;

			}
}

			}
}

	}

// Fetch latest user if the user count is changing

	}

// Fetch latest user if the user count is changing

	if(array_key_exists('numusers', $changes))

	if(array_key_exists('numusers', $changes) || array_key_exists('lastuser', $changes))

	{
$query = $db->simple_select(TABLE_PREFIX."users", "uid, username", "", array('order_by' => 'uid', 'order_dir' => 'DESC', 'limit' => 1));
$lastmember = $db->fetch_array($query);

	{
$query = $db->simple_select(TABLE_PREFIX."users", "uid, username", "", array('order_by' => 'uid', 'order_dir' => 'DESC', 'limit' => 1));
$lastmember = $db->fetch_array($query);

Zeile 1336Zeile 1358
			if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
$update_query[$counter] = $forum[$counter] + $changes[$counter];

			if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
$update_query[$counter] = $forum[$counter] + $changes[$counter];

			}
else
{
$update_query[$counter] = $changes[$counter];
}
// Less than 0? That's bad
if($update_query[$counter] < 0)
{
$update_query[$counter] = 0;
}
}

			}
else
{
$update_query[$counter] = $changes[$counter];
}
// Less than 0? That's bad
if($update_query[$counter] < 0)
{
$update_query[$counter] = 0;
}
}

	}

// Only update if we're actually doing something

	}

// Only update if we're actually doing something

Zeile 1356Zeile 1378
	}

// Guess we should update the statistics too?

	}

// Guess we should update the statistics too?

	if($update_query['threads'] || $update_query['posts'])

	if(isset($update_query['threads']) || isset($update_query['posts']))

	{
$new_stats = array();
if(array_key_exists('threads', $update_query))

	{
$new_stats = array();
if(array_key_exists('threads', $update_query))

Zeile 1382Zeile 1404
			{
$new_stats['numposts'] = "{$posts_diff}";
}

			{
$new_stats['numposts'] = "{$posts_diff}";
}

		}


		}	


		update_stats($new_stats);
}

		update_stats($new_stats);
}



	

	// Update last post info
update_forum_lastpost($fid);
}

	// Update last post info
update_forum_lastpost($fid);
}

Zeile 1463Zeile 1486
	if(count($update_query) > 0)
{
$db->update_query(TABLE_PREFIX."threads", $update_query, "tid='".intval($tid)."'");

	if(count($update_query) > 0)
{
$db->update_query(TABLE_PREFIX."threads", $update_query, "tid='".intval($tid)."'");

	}

	}


update_thread_data($tid);
}


update_thread_data($tid);
}

Zeile 1585Zeile 1608
 */
function build_forum_jump($pid="0", $selitem="", $addselect="1", $depth="", $showextras="1", $permissions="", $name="fid")
{

 */
function build_forum_jump($pid="0", $selitem="", $addselect="1", $depth="", $showextras="1", $permissions="", $name="fid")
{

	global $db, $forum_cache, $fjumpcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;

	global $db, $forum_cache, $jumpfcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;


$pid = intval($pid);
if($permissions)


$pid = intval($pid);
if($permissions)

Zeile 1625Zeile 1648
						$optionselected = "selected=\"selected\"";
$selecteddone = 1;
}

						$optionselected = "selected=\"selected\"";
$selecteddone = 1;
}

 
					
$forum['name'] = htmlspecialchars_uni($forum['name']);


					eval("\$forumjumpbits .= \"".$templates->get("forumjump_bit")."\";");
if($forum_cache[$forum['fid']])
{

					eval("\$forumjumpbits .= \"".$templates->get("forumjump_bit")."\";");
if($forum_cache[$forum['fid']])
{

Zeile 2095Zeile 2121
	{
$attachtypes = $cache->read("attachtypes");
}

	{
$attachtypes = $cache->read("attachtypes");
}

 
	
$directory = "";

if(defined("IN_PORTAL"))
{
global $change_dir;
$directory = $change_dir."/";
}


	$ext = strtolower($ext);
if($attachtypes[$ext]['icon'])
{

	$ext = strtolower($ext);
if($attachtypes[$ext]['icon'])
{

		return "<img src=\"".$attachtypes[$ext]['icon']."\" border=\"0\" alt=\".$ext File\" />";

		return "<img src=\"{$directory}".$attachtypes[$ext]['icon']."\" border=\"0\" alt=\".$ext File\" />";

	}
else
{

	}
else
{

		return "<img src=\"images/attachtypes/unknown.gif\" border=\"0\" alt=\".$ext File\" />";

		return "<img src=\"{$directory}images/attachtypes/unknown.gif\" border=\"0\" alt=\".$ext File\" />";

	}
}


	}
}


Zeile 2172Zeile 2207
	$format = str_replace("Y", $year, $format);
$format = str_replace("y", my_substr($year, -2), $format);
return $format;

	$format = str_replace("Y", $year, $format);
$format = str_replace("y", my_substr($year, -2), $format);
return $format;

}

/**

}

/**

 * Build the breadcrumb navigation trail from the specified items
*
* @return The formatted breadcrumb navigation trail

 * Build the breadcrumb navigation trail from the specified items
*
* @return The formatted breadcrumb navigation trail

Zeile 2184Zeile 2219
	global $nav, $navbits, $templates, $theme, $lang;

eval("\$navsep = \"".$templates->get("nav_sep")."\";");

	global $nav, $navbits, $templates, $theme, $lang;

eval("\$navsep = \"".$templates->get("nav_sep")."\";");





	if(is_array($navbits))
{
reset($navbits);

	if(is_array($navbits))
{
reset($navbits);

Zeile 2213Zeile 2248
 *
* @param string The name of the item to add
* @param string The URL of the item to add

 *
* @param string The name of the item to add
* @param string The URL of the item to add

 */

 */

function add_breadcrumb($name, $url="")
{
global $navbits;

function add_breadcrumb($name, $url="")
{
global $navbits;

Zeile 2251Zeile 2286
			if($fid == $forumnav['fid'])
{
if($pforumcache[$forumnav['pid']])

			if($fid == $forumnav['fid'])
{
if($pforumcache[$forumnav['pid']])

				{

				{

					build_forum_breadcrumb($forumnav['pid'], $archive);
}
$navsize = count($navbits);

					build_forum_breadcrumb($forumnav['pid'], $archive);
}
$navsize = count($navbits);

Zeile 2260Zeile 2295
				{
// Set up link to forum in breadcrumb.
if($pforumcache[$fid][$forumnav['pid']]['type'] == 'f' || $pforumcache[$fid][$forumnav['pid']]['type'] == 'c')

				{
// Set up link to forum in breadcrumb.
if($pforumcache[$fid][$forumnav['pid']]['type'] == 'f' || $pforumcache[$fid][$forumnav['pid']]['type'] == 'c')

					{

					{

						$navbits[$navsize]['url'] = "{$base_url}forum-".$forumnav['fid'].".html";
}
else

						$navbits[$navsize]['url'] = "{$base_url}forum-".$forumnav['fid'].".html";
}
else

Zeile 2284Zeile 2319
function reset_breadcrumb()
{
global $navbits;

function reset_breadcrumb()
{
global $navbits;





	$newnav[0]['name'] = $navbits[0]['name'];
$newnav[0]['url'] = $navbits[0]['url'];
unset($GLOBALS['navbits']);
$GLOBALS['navbits'] = $newnav;

	$newnav[0]['name'] = $navbits[0]['name'];
$newnav[0]['url'] = $navbits[0]['url'];
unset($GLOBALS['navbits']);
$GLOBALS['navbits'] = $newnav;

}


}


/**
* Builds a URL to an archive mode page
*

/**
* Builds a URL to an archive mode page
*

Zeile 2351Zeile 2386
		$gzipen = "Disabled";
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";

		$gzipen = "Disabled";
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";

	echo "<html lang=\"en\">";

	echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";

	echo "<head>";
echo "<title>MyBB Debug Information</title>";
echo "</head>";

	echo "<head>";
echo "<title>MyBB Debug Information</title>";
echo "</head>";

Zeile 2407Zeile 2442
	echo "<h2>Database Queries (".$db->query_count." Total) </h2>\n";
echo $db->explain;
echo "<h2>Template Statistics</h2>\n";

	echo "<h2>Database Queries (".$db->query_count." Total) </h2>\n";
echo $db->explain;
echo "<h2>Template Statistics</h2>\n";





	if(count($templates->cache) > 0)
{
echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";

	if(count($templates->cache) > 0)
{
echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";

Zeile 2879Zeile 2914
 */
function htmlspecialchars_uni($message)
{

 */
function htmlspecialchars_uni($message)
{

	$message = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&#038;$1", $message); // Fix & but allow unicode

	$message = preg_replace("#&(?!\#[0-9]+;)#si", "&amp;", $message); // Fix & but allow unicode

	$message = str_replace("<","&lt;",$message);
$message = str_replace(">","&gt;",$message);
$message = str_replace("\"","&quot;",$message);

	$message = str_replace("<","&lt;",$message);
$message = str_replace(">","&gt;",$message);
$message = str_replace("\"","&quot;",$message);

Zeile 3334Zeile 3369
}

/**

}

/**

 * Get the username of a user id.

 * Get the user data of a user id.

 *
* @param int The user id of the user.

 *
* @param int The user id of the user.

 * @return string The username of the user.

 * @return array The user data.

 */
function get_user($uid)
{

 */
function get_user($uid)
{

Zeile 3349Zeile 3384
		return $mybb->user;
}
elseif(isset($user_cache[$uid]))

		return $mybb->user;
}
elseif(isset($user_cache[$uid]))

	{
return $user_cache[$uid];

	{
return $user_cache[$uid];

	}
else
{

	}
else
{

Zeile 3408Zeile 3443
 * @return string The database row of the thread.
*/
function get_thread($tid)

 * @return string The database row of the thread.
*/
function get_thread($tid)

{
global $db;

{
global $db;

	static $thread_cache;

if(isset($thread_cache[$tid]))

	static $thread_cache;

if(isset($thread_cache[$tid]))

Zeile 3579Zeile 3614
		return false;
}
// Valid local characters for email addresses: http://www.remote.org/jochen/mail/info/chars.html

		return false;
}
// Valid local characters for email addresses: http://www.remote.org/jochen/mail/info/chars.html

	return preg_match("/^[a-zA-Z0-9&*+\-_.{}~^?=\/]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $email);

	return preg_match("/^[a-zA-Z0-9&*+\-_.{}~^\?=\/]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $email);

}

/**

}

/**

Zeile 3822Zeile 3857
	{
return @implode("", @file($url));
}

	{
return @implode("", @file($url));
}

 
}

/**
* Unicode function for php function chr()
*
* @param string The character
* @return mixed The unicoded chr()
*/
function unicode_chr($c)
{
if($c <= 0x7F)
{
return chr($c);
}
elseif($c <= 0x7FF)
{
return chr(0xC0 | $c >> 6) . chr(0x80 | $c & 0x3F);
}
elseif($c <= 0xFFFF)
{
return chr(0xE0 | $c >> 12) . chr(0x80 | $c >> 6 & 0x3F)
. chr(0x80 | $c & 0x3F);
}
elseif($c <= 0x10FFFF)
{
return chr(0xF0 | $c >> 18) . chr(0x80 | $c >> 12 & 0x3F)
. chr(0x80 | $c >> 6 & 0x3F)
. chr(0x80 | $c & 0x3F);
}
else
{
return false;
}

}

/**

}

/**