Vergleich inc/functions.php - 1.8.34 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1694Zeile 1694
{
global $groupscache, $forum_cache, $fpermcache, $mybb, $fpermfields;


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


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








    if(isset($gid))
{
$groups = explode(",", $gid);
}
else
{
$groups = array();
}


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


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

Zeile 2611Zeile 2618
	}

return $out;

	}

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
*/
function native_unserialize($str)
{
if(version_compare(PHP_VERSION, '7.0.0', '>='))
{
return unserialize($str, array('allowed_classes' => false));
}
else
{
return unserialize($str);
}

}

/**

}

/**

Zeile 2633Zeile 2659
	if(is_bool($value))
{
return 'b:'.(int)$value.';';

	if(is_bool($value))
{
return 'b:'.(int)$value.';';

	}

	}


if(is_int($value))
{


if(is_int($value))
{

Zeile 2688Zeile 2714
	}

return $out;

	}

return $out;

}

/**

}

/**

 * Returns the serverload of the system.
*
* @return int The serverload of the system.

 * Returns the serverload of the system.
*
* @return int The serverload of the system.

Zeile 2708Zeile 2734
		{
// sys_getloadavg() will return an array with [0] being load within the last minute.
$serverload = sys_getloadavg();

		{
// sys_getloadavg() will return an array with [0] being load within the last minute.
$serverload = sys_getloadavg();

 

if(!is_array($serverload))
{
return $lang->unknown;
}


			$serverload[0] = round($serverload[0], 4);
}
else if(@file_exists("/proc/loadavg") && $load = @file_get_contents("/proc/loadavg"))

			$serverload[0] = round($serverload[0], 4);
}
else if(@file_exists("/proc/loadavg") && $load = @file_get_contents("/proc/loadavg"))

Zeile 2993Zeile 3025
		if($posts_diff > -1)
{
$new_stats['numposts'] = "+{$posts_diff}";

		if($posts_diff > -1)
{
$new_stats['numposts'] = "+{$posts_diff}";

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

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

	}

if(array_key_exists('unapprovedposts', $update_query))

	}

if(array_key_exists('unapprovedposts', $update_query))

Zeile 3006Zeile 3038
		if($unapprovedposts_diff > -1)
{
$new_stats['numunapprovedposts'] = "+{$unapprovedposts_diff}";

		if($unapprovedposts_diff > -1)
{
$new_stats['numunapprovedposts'] = "+{$unapprovedposts_diff}";

		}
else

		}
else

		{
$new_stats['numunapprovedposts'] = "{$unapprovedposts_diff}";
}

		{
$new_stats['numunapprovedposts'] = "{$unapprovedposts_diff}";
}

Zeile 3073Zeile 3105
			"lastposteruid" => (int)$lastpost['lastposteruid'],
"lastposttid" => (int)$lastpost['tid'],
"lastpostsubject" => $db->escape_string($lastpost['subject']),

			"lastposteruid" => (int)$lastpost['lastposteruid'],
"lastposttid" => (int)$lastpost['tid'],
"lastpostsubject" => $db->escape_string($lastpost['subject']),

		);

		);

	}
else {
$updated_forum = array(

	}
else {
$updated_forum = array(

Zeile 3225Zeile 3257
 * @param array $changes Array of items being updated (postnum, threadnum) and their value (ex, 1, +1, -1)
*/
function update_user_counters($uid, $changes=array())

 * @param array $changes Array of items being updated (postnum, threadnum) and their value (ex, 1, +1, -1)
*/
function update_user_counters($uid, $changes=array())

{
global $db;

{
global $db;


$update_query = array();



$update_query = array();


Zeile 3236Zeile 3268
	// Fetch above counters for this user
$query = $db->simple_select("users", implode(",", $counters), "uid='{$uid}'");
$user = $db->fetch_array($query);

	// Fetch above counters for this user
$query = $db->simple_select("users", implode(",", $counters), "uid='{$uid}'");
$user = $db->fetch_array($query);


foreach($counters as $counter)

	
if($user)

	{

	{

		if(array_key_exists($counter, $changes))

		foreach($counters as $counter)

		{

		{

			if(substr($changes[$counter], 0, 2) == "+-")
{
$changes[$counter] = substr($changes[$counter], 1);
}
// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")

			if(array_key_exists($counter, $changes))






			{

			{

				if((int)$changes[$counter] != 0)

				if(substr($changes[$counter], 0, 2) == "+-")

				{

				{

					$update_query[$counter] = $user[$counter] + $changes[$counter];













					$changes[$counter] = substr($changes[$counter], 1);
}
// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
if((int)$changes[$counter] != 0)
{
$update_query[$counter] = $user[$counter] + $changes[$counter];
}
}
else
{
$update_query[$counter] = $changes[$counter];

				}

				}

			}
else
{
$update_query[$counter] = $changes[$counter];
}

 




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


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

			}
}
}

			}
}
}

Zeile 3884Zeile 3919
		$query = $db->simple_select("threadsubscriptions", "tid, notification", "tid='".(int)$tid."' AND uid='".$mybb->user['uid']."'", array('limit' => 1));
$subscription = $db->fetch_array($query);


		$query = $db->simple_select("threadsubscriptions", "tid, notification", "tid='".(int)$tid."' AND uid='".$mybb->user['uid']."'", array('limit' => 1));
$subscription = $db->fetch_array($query);


		if(!empty($subscription) && $subscription['tid'])

		if($subscription)

		{
$subscription_method = (int)$subscription['notification'] + 1;
}

		{
$subscription_method = (int)$subscription['notification'] + 1;
}

Zeile 4451Zeile 4486
				if(my_inet_ntop(my_inet_pton($val)) == $val && !preg_match("#^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|fe80:|fe[c-f][0-f]:|f[c-d][0-f]{2}:)#", $val))
{
$ip = $val;

				if(my_inet_ntop(my_inet_pton($val)) == $val && !preg_match("#^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|fe80:|fe[c-f][0-f]:|f[c-d][0-f]{2}:)#", $val))
{
$ip = $val;

					break;
}

					break;
}

			}
}
}

			}
}
}

Zeile 4603Zeile 4638
			{
$attach_icons_schemes[$ext] = str_replace("{theme}", "", $attachtypes[$ext]['icon']);
if(my_substr($attach_icons_schemes[$ext], 0, 1) != "/")

			{
$attach_icons_schemes[$ext] = str_replace("{theme}", "", $attachtypes[$ext]['icon']);
if(my_substr($attach_icons_schemes[$ext], 0, 1) != "/")

				{

				{

					$attach_icons_schemes[$ext] = "../".$attach_icons_schemes[$ext];
}

					$attach_icons_schemes[$ext] = "../".$attach_icons_schemes[$ext];
}

			}

			}

			elseif(defined("IN_PORTAL"))
{
global $change_dir;
$attach_icons_schemes[$ext] = $change_dir."/".str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);

			elseif(defined("IN_PORTAL"))
{
global $change_dir;
$attach_icons_schemes[$ext] = $change_dir."/".str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);

				$attach_icons_schemes[$ext] = $mybb->get_asset_url($attach_icons_schemes[$ext]);
}

				$attach_icons_schemes[$ext] = $mybb->get_asset_url($attach_icons_schemes[$ext]);
}

			else
{
$attach_icons_schemes[$ext] = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);
$attach_icons_schemes[$ext] = $mybb->get_asset_url($attach_icons_schemes[$ext]);
}

			else
{
$attach_icons_schemes[$ext] = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);
$attach_icons_schemes[$ext] = $mybb->get_asset_url($attach_icons_schemes[$ext]);
}

		}

$icon = $attach_icons_schemes[$ext];


		}

$icon = $attach_icons_schemes[$ext];


		$name = htmlspecialchars_uni($attachtypes[$ext]['name']);
}
else

		$name = htmlspecialchars_uni($attachtypes[$ext]['name']);
}
else

Zeile 4639Zeile 4674
		$icon = "{$theme['imgdir']}/attachtypes/unknown.png";

$name = $lang->unknown;

		$icon = "{$theme['imgdir']}/attachtypes/unknown.png";

$name = $lang->unknown;

	}

	}


$icon = htmlspecialchars_uni($icon);
eval("\$attachment_icon = \"".$templates->get("attachment_icon")."\";");


$icon = htmlspecialchars_uni($icon);
eval("\$attachment_icon = \"".$templates->get("attachment_icon")."\";");

Zeile 4657Zeile 4692
	global $forum_cache, $permissioncache, $mybb;

if(!is_array($forum_cache))

	global $forum_cache, $permissioncache, $mybb;

if(!is_array($forum_cache))

	{

	{

		cache_forums();
}


		cache_forums();
}


Zeile 4676Zeile 4711
		else
{
$perms = $mybb->usergroup;

		else
{
$perms = $mybb->usergroup;

		}

$pwverified = 1;


		}

$pwverified = 1;



if(!forum_password_validated($forum, true))
{


if(!forum_password_validated($forum, true))
{

Zeile 4697Zeile 4732
					break;
}
}

					break;
}
}

		}


		}


		if($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_threads == true && $perms['canviewthreads'] == 0))
{
$unviewable[] = $forum['fid'];

		if($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_threads == true && $perms['canviewthreads'] == 0))
{
$unviewable[] = $forum['fid'];

Zeile 4708Zeile 4743
	$unviewableforums = implode(',', $unviewable);

return $unviewableforums;

	$unviewableforums = implode(',', $unviewable);

return $unviewableforums;

}

}


/**
* Fixes mktime for dates earlier than 1970


/**
* Fixes mktime for dates earlier than 1970

Zeile 4755Zeile 4790
				else
{
$sep = "";

				else
{
$sep = "";

				}

				}


$multipage = null;
$multipage_dropdown = null;


$multipage = null;
$multipage_dropdown = null;

Zeile 4764Zeile 4799
					if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;

					if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;

					}

					}


$multipage = multipage($navbit['multipage']['num_threads'], $mybb->settings['threadsperpage'], $navbit['multipage']['current_page'], $navbit['multipage']['url'], true);
if($multipage)


$multipage = multipage($navbit['multipage']['num_threads'], $mybb->settings['threadsperpage'], $navbit['multipage']['current_page'], $navbit['multipage']['url'], true);
if($multipage)

Zeile 4802Zeile 4837
 *
* @param string $name The name of the item to add
* @param string $url The URL of the item to add

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

 */

 */

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

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

Zeile 4811Zeile 4846
	$navbits[$navsize]['name'] = $name;
$navbits[$navsize]['url'] = $url;
}

	$navbits[$navsize]['name'] = $name;
$navbits[$navsize]['url'] = $url;
}





/**
* Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)
*

/**
* Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)
*

Zeile 4831Zeile 4866
		}

foreach($forum_cache as $key => $val)

		}

foreach($forum_cache as $key => $val)

		{

		{

			$pforumcache[$val['fid']][$val['pid']] = $val;
}
}

			$pforumcache[$val['fid']][$val['pid']] = $val;
}
}

Zeile 4887Zeile 4922
function reset_breadcrumb()
{
global $navbits;

function reset_breadcrumb()
{
global $navbits;





	$newnav[0]['name'] = $navbits[0]['name'];
$newnav[0]['url'] = $navbits[0]['url'];
if(!empty($navbits[0]['options']))

	$newnav[0]['name'] = $navbits[0]['name'];
$newnav[0]['url'] = $navbits[0]['url'];
if(!empty($navbits[0]['options']))

Zeile 4907Zeile 4942
 * @return string The URL
*/
function build_archive_link($type="", $id=0)

 * @return string The URL
*/
function build_archive_link($type="", $id=0)

{

{

	global $mybb;

// If the server OS is not Windows and not Apache or the PHP is running as a CGI or we have defined ARCHIVE_QUERY_STRINGS, use query strings - DIRECTORY_SEPARATOR checks if running windows

	global $mybb;

// If the server OS is not Windows and not Apache or the PHP is running as a CGI or we have defined ARCHIVE_QUERY_STRINGS, use query strings - DIRECTORY_SEPARATOR checks if running windows

Zeile 4915Zeile 4950
	if($mybb->settings['seourls_archive'] == 1)
{
$base_url = $mybb->settings['bburl']."/archive/index.php/";

	if($mybb->settings['seourls_archive'] == 1)
{
$base_url = $mybb->settings['bburl']."/archive/index.php/";

	}
else

	}
else

	{
$base_url = $mybb->settings['bburl']."/archive/index.php?";
}

	{
$base_url = $mybb->settings['bburl']."/archive/index.php?";
}

Zeile 4925Zeile 4960
	{
case "thread":
$url = "{$base_url}thread-{$id}.html";

	{
case "thread":
$url = "{$base_url}thread-{$id}.html";

			break;

			break;

		case "announcement":
$url = "{$base_url}announcement-{$id}.html";

		case "announcement":
$url = "{$base_url}announcement-{$id}.html";

			break;

			break;

		case "forum":
$url = "{$base_url}forum-{$id}.html";
break;
default:
$url = $mybb->settings['bburl']."/archive/index.php";

		case "forum":
$url = "{$base_url}forum-{$id}.html";
break;
default:
$url = $mybb->settings['bburl']."/archive/index.php";

	}


	}


	return $url;
}


	return $url;
}


Zeile 4983Zeile 5018
	echo "<h1>MyBB Debug Information</h1>\n";
echo "<h2>Page Generation</h2>\n";
echo "<table bgcolor=\"#666666\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";

	echo "<h1>MyBB Debug Information</h1>\n";
echo "<h2>Page Generation</h2>\n";
echo "<table bgcolor=\"#666666\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";

	echo "<tr>\n";

	echo "<tr>\n";

	echo "<td bgcolor=\"#cccccc\" colspan=\"4\"><b><span style=\"size:2;\">Page Generation Statistics</span></b></td>\n";
echo "</tr>\n";
echo "<tr>\n";

	echo "<td bgcolor=\"#cccccc\" colspan=\"4\"><b><span style=\"size:2;\">Page Generation Statistics</span></b></td>\n";
echo "</tr>\n";
echo "<tr>\n";

Zeile 5021Zeile 5056
	if(!$memory_usage)
{
$memory_usage = $lang->unknown;

	if(!$memory_usage)
{
$memory_usage = $lang->unknown;

	}

	}

	else
{
$memory_usage = get_friendly_size($memory_usage)." ({$memory_usage} bytes)";

	else
{
$memory_usage = get_friendly_size($memory_usage)." ({$memory_usage} bytes)";

Zeile 5060Zeile 5095
		echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";
echo "<tr>\n";
echo "<td style=\"background-color: #ccc;\"><strong>Templates Used (Loaded for this Page) - ".count($templates->cache)." Total</strong></td>\n";

		echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";
echo "<tr>\n";
echo "<td style=\"background-color: #ccc;\"><strong>Templates Used (Loaded for this Page) - ".count($templates->cache)." Total</strong></td>\n";

		echo "</tr>\n";
echo "<tr>\n";
echo "<td style=\"background: #fff;\">".implode(", ", array_keys($templates->cache))."</td>\n";
echo "</tr>\n";
echo "</table>\n";

		echo "</tr>\n";
echo "<tr>\n";
echo "<td style=\"background: #fff;\">".implode(", ", array_keys($templates->cache))."</td>\n";
echo "</tr>\n";
echo "</table>\n";

		echo "<br />\n";
}


		echo "<br />\n";
}


Zeile 5217Zeile 5252
	{
$options = array_merge(array(
'days' => false,

	{
$options = array_merge(array(
'days' => false,

			'hours' => false,
'minutes' => false,

			'hours' => false,
'minutes' => false,

			'seconds' => false
), $options);
}

			'seconds' => false
), $options);
}

Zeile 5524Zeile 5559
		{
$current_query_string = $_ENV['QUERY_STRING'];
} else

		{
$current_query_string = $_ENV['QUERY_STRING'];
} else

		{

		{

			$current_query_string = '';
}


			$current_query_string = '';
}


Zeile 5676Zeile 5711
	}

return $s_theme;

	}

return $s_theme;

}


}


/**
* Custom function for htmlspecialchars which takes in to account unicode
*

/**
* Custom function for htmlspecialchars which takes in to account unicode
*

Zeile 5714Zeile 5749
	}
else
{

	}
else
{

		$parts = explode('.', $number);








        if(isset($number))
{
$parts = explode('.', $number);
}
else
{
$parts = array();
}


if(isset($parts[1]))
{


if(isset($parts[1]))
{

Zeile 5831Zeile 5873
		$j = get_bdays($i);

for($k = 11; $k >= 0; $k--)

		$j = get_bdays($i);

for($k = 11; $k >= 0; $k--)

		{

		{

			$l = ($k + 1);

for($m = $j[$k]; $m >= 1; $m--)

			$l = ($k + 1);

for($m = $j[$k]; $m >= 1; $m--)

Zeile 5984Zeile 6026
{
$bday = explode("-", $birthday);
if(!$bday[2])

{
$bday = explode("-", $birthday);
if(!$bday[2])

	{

	{

		return;
}

		return;
}





	list($day, $month, $year) = explode("-", my_date("j-n-Y", TIME_NOW, 0, 0));

	list($day, $month, $year) = explode("-", my_date("j-n-Y", TIME_NOW, 0, 0));





	$age = $year-$bday[2];

if(($month == $bday[1] && $day < $bday[0]) || $month < $bday[1])

	$age = $year-$bday[2];

if(($month == $bday[1] && $day < $bday[0]) || $month < $bday[1])

	{

	{

		--$age;
}
return $age;

		--$age;
}
return $age;

Zeile 6021Zeile 6063
	if(empty($firstpost['username']))
{
$firstpost['username'] = $firstpost['postusername'];

	if(empty($firstpost['username']))
{
$firstpost['username'] = $firstpost['postusername'];

	}

	}

	$firstpost['username'] = $db->escape_string($firstpost['username']);

$update_array = array(

	$firstpost['username'] = $db->escape_string($firstpost['username']);

$update_array = array(

Zeile 6060Zeile 6102
	if(empty($lastpost['username']))
{
$lastpost['username'] = $lastpost['postusername'];

	if(empty($lastpost['username']))
{
$lastpost['username'] = $lastpost['postusername'];

	}


	}


	if(empty($lastpost['dateline']))
{
$query = $db->query("

	if(empty($lastpost['dateline']))
{
$query = $db->query("

Zeile 6077Zeile 6119
		$lastpost['username'] = $firstpost['username'];
$lastpost['uid'] = $firstpost['uid'];
$lastpost['dateline'] = $firstpost['dateline'];

		$lastpost['username'] = $firstpost['username'];
$lastpost['uid'] = $firstpost['uid'];
$lastpost['dateline'] = $firstpost['dateline'];

	}

$lastpost['username'] = $db->escape_string($lastpost['username']);


	}

$lastpost['username'] = $db->escape_string($lastpost['username']);


	$update_array = array(
'lastpost' => (int)$lastpost['dateline'],
'lastposter' => $lastpost['username'],

	$update_array = array(
'lastpost' => (int)$lastpost['dateline'],
'lastposter' => $lastpost['username'],

Zeile 6101Zeile 6143

$string = preg_replace("#&\#([0-9]+);#", "-", $string);



$string = preg_replace("#&\#([0-9]+);#", "-", $string);


	if(strtolower($lang->settings['charset']) == "utf-8")

	if(isset($lang->settings['charset']) && strtolower($lang->settings['charset']) == "utf-8")

	{
// Get rid of any excess RTL and LTR override for they are the workings of the devil
$string = str_replace(dec_to_utf8(8238), "", $string);

	{
// Get rid of any excess RTL and LTR override for they are the workings of the devil
$string = str_replace(dec_to_utf8(8238), "", $string);

Zeile 6138Zeile 6180
	if($handle_entities)
{
$string = unhtmlentities($string);

	if($handle_entities)
{
$string = unhtmlentities($string);

	}

	}

	if(function_exists("mb_substr"))
{
if($length != null)

	if(function_exists("mb_substr"))
{
if($length != null)

Zeile 6165Zeile 6207
	if($handle_entities)
{
$cut_string = htmlspecialchars_uni($cut_string);

	if($handle_entities)
{
$cut_string = htmlspecialchars_uni($cut_string);

	}

	}

	return $cut_string;
}


	return $cut_string;
}


Zeile 6174Zeile 6216
 *
* @param string $string The string to lower.
* @return string The lowered string.

 *
* @param string $string The string to lower.
* @return string The lowered string.

 */

 */

function my_strtolower($string)
{
if(function_exists("mb_strtolower"))

function my_strtolower($string)
{
if(function_exists("mb_strtolower"))

Zeile 6211Zeile 6253
	else
{
$position = stripos($haystack, $needle, $offset);

	else
{
$position = stripos($haystack, $needle, $offset);

	}

return $position;
}


	}

return $position;
}


/**
* Finds a needle in a haystack and returns it position, mb strings accounted for
*

/**
* Finds a needle in a haystack and returns it position, mb strings accounted for
*

Zeile 6225Zeile 6267
 * @return int|bool false on needle not found, integer position if found
*/
function my_strpos($haystack, $needle, $offset=0)

 * @return int|bool false on needle not found, integer position if found
*/
function my_strpos($haystack, $needle, $offset=0)

{

{

	if($needle == '')

	if($needle == '')

	{

	{

		return false;
}

if(function_exists("mb_strpos"))
{
$position = mb_strpos($haystack, $needle, $offset);

		return false;
}

if(function_exists("mb_strpos"))
{
$position = mb_strpos($haystack, $needle, $offset);

	}

	}

	else
{
$position = strpos($haystack, $needle, $offset);

	else
{
$position = strpos($haystack, $needle, $offset);

Zeile 6261Zeile 6303
	}

return $string;

	}

return $string;

}

/**

}

/**

 * Returns any html entities to their original character
*
* @param string $string The string to un-htmlentitize.

 * Returns any html entities to their original character
*
* @param string $string The string to un-htmlentitize.

Zeile 6291Zeile 6333
function unichr($c)
{
if($c <= 0x7F)

function unichr($c)
{
if($c <= 0x7F)

	{

	{

		return chr($c);
}
else if($c <= 0x7FF)

		return chr($c);
}
else if($c <= 0x7FF)

Zeile 7026Zeile 7068
		"~"
);
$terms = str_replace($bad_characters, '', $terms);

		"~"
);
$terms = str_replace($bad_characters, '', $terms);

 
	$words = array();


// Check if this is a "series of words" - should be treated as an EXACT match
if(my_strpos($terms, "\"") !== false)
{
$inquote = false;
$terms = explode("\"", $terms);


// Check if this is a "series of words" - should be treated as an EXACT match
if(my_strpos($terms, "\"") !== false)
{
$inquote = false;
$terms = explode("\"", $terms);

		$words = array();

 
		foreach($terms as $phrase)
{
$phrase = htmlspecialchars_uni($phrase);

		foreach($terms as $phrase)
{
$phrase = htmlspecialchars_uni($phrase);

Zeile 7078Zeile 7120
				$words[] = trim($word);
}
}

				$words[] = trim($word);
}
}

	}

if(!is_array($words))
{
return false;

 
	}

// Sort the word array by length. Largest terms go first and work their way down to the smallest term.
// This resolves problems like "test tes" where "tes" will be highlighted first, then "test" can't be highlighted because of the changed html
usort($words, 'build_highlight_array_sort');

	}

// Sort the word array by length. Largest terms go first and work their way down to the smallest term.
// This resolves problems like "test tes" where "tes" will be highlighted first, then "test" can't be highlighted because of the changed html
usort($words, 'build_highlight_array_sort');

 

$highlight_cache = array();


// Loop through our words to build the PREG compatible strings
foreach($words as $word)


// Loop through our words to build the PREG compatible strings
foreach($words as $word)

Zeile 7109Zeile 7148
	}

return $highlight_cache;

	}

return $highlight_cache;

}

}


/**
* Sort the word array by length. Largest terms go first and work their way down to the smallest term.


/**
* Sort the word array by length. Largest terms go first and work their way down to the smallest term.

Zeile 7122Zeile 7161
{
return strlen($b) - strlen($a);
}

{
return strlen($b) - strlen($a);
}





/**
* Converts a decimal reference of a character to its UTF-8 equivalent
* (Code by Anne van Kesteren, http://annevankesteren.nl/2005/05/character-references)

/**
* Converts a decimal reference of a character to its UTF-8 equivalent
* (Code by Anne van Kesteren, http://annevankesteren.nl/2005/05/character-references)

Zeile 7135Zeile 7174
	$dest = '';

if($src < 0)

	$dest = '';

if($src < 0)

	{

	{

		return false;
}
elseif($src <= 0x007f)

		return false;
}
elseif($src <= 0x007f)

Zeile 7190Zeile 7229
			if($update_lastuse == true)
{
$db->update_query("banfilters", array("lastuse" => TIME_NOW), "fid='{$banned_username['fid']}'");

			if($update_lastuse == true)
{
$db->update_query("banfilters", array("lastuse" => TIME_NOW), "fid='{$banned_username['fid']}'");

			}

			}

			return true;
}
}

			return true;
}
}

Zeile 7299Zeile 7338
 * Returns an array of supported timezones
*
* @return string[] Key is timezone offset, Value the language description

 * Returns an array of supported timezones
*
* @return string[] Key is timezone offset, Value the language description

 */

 */

function get_supported_timezones()
{
global $lang;

function get_supported_timezones()
{
global $lang;

Zeile 7518Zeile 7557
			$curlopt[10203] = array(
$url_components['host'].':'.$url_components['port'].':'.$destination_address
);

			$curlopt[10203] = array(
$url_components['host'].':'.$url_components['port'].':'.$destination_address
);

 
		}

if(defined('CURLOPT_DISALLOW_USERNAME_IN_URL'))
{
$curlopt[CURLOPT_DISALLOW_USERNAME_IN_URL] = true;

		}

if(!empty($post_body))

		}

if(!empty($post_body))