Vergleich inc/functions.php - 1.6.13 - 1.6.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 21Zeile 21

$contents = parse_page($contents);
$totaltime = $maintimer->stop();


$contents = parse_page($contents);
$totaltime = $maintimer->stop();

 
	$contents = $plugins->run_hooks("pre_output_page", $contents);


if($mybb->usergroup['cancp'] == 1)
{


if($mybb->usergroup['cancp'] == 1)
{

Zeile 83Zeile 84
			$other = "PHP version: $phpversion / Server Load: $serverload / GZip Compression: $gzipen";
$debugstuff = "Generated in $totaltime seconds ($percentphp% PHP / $percentsql% ".$database_server.")<br />SQL Queries: $db->query_count / Global Parsing Time: $globaltime$memory_usage<br />$other<br />[<a href=\"$debuglink\" target=\"_blank\">advanced details</a>]<br />";
$contents = str_replace("<debugstuff>", $debugstuff, $contents);

			$other = "PHP version: $phpversion / Server Load: $serverload / GZip Compression: $gzipen";
$debugstuff = "Generated in $totaltime seconds ($percentphp% PHP / $percentsql% ".$database_server.")<br />SQL Queries: $db->query_count / Global Parsing Time: $globaltime$memory_usage<br />$other<br />[<a href=\"$debuglink\" target=\"_blank\">advanced details</a>]<br />";
$contents = str_replace("<debugstuff>", $debugstuff, $contents);

		}

		}


if($mybb->debug_mode == true)
{


if($mybb->debug_mode == true)
{

Zeile 92Zeile 93
	}

$contents = str_replace("<debugstuff>", "", $contents);

	}

$contents = str_replace("<debugstuff>", "", $contents);

	$contents = $plugins->run_hooks("pre_output_page", $contents);

 

if($mybb->settings['gzipoutput'] == 1)
{


if($mybb->settings['gzipoutput'] == 1)
{

Zeile 1466Zeile 1466

$mod_cache = $cache->read("moderators");



$mod_cache = $cache->read("moderators");


	foreach($mod_cache as $fid => $forum)

	foreach($mod_cache as $forumid => $forum)

	{

	{

		if(!is_array($forum) || !in_array($fid, $parentslist))

		if(!is_array($forum) || !in_array($forumid, $parentslist))

		{
// No perms or we're not after this forum
continue;

		{
// No perms or we're not after this forum
continue;

Zeile 1549Zeile 1549
	$user_perms = user_permissions($uid);
if($user_perms['issupermod'] == 1)
{

	$user_perms = user_permissions($uid);
if($user_perms['issupermod'] == 1)
{

 
		if($fid)
{
$forumpermissions = forum_permissions($fid);
if($forumpermissions['canview'] && $forumpermissions['canviewthreads'] && !$forumpermissions['canonlyviewownthreads'])
{
return true;
}
return false;
}

		return true;
}
else

		return true;
}
else

Zeile 1561Zeile 1570
				foreach($modcache as $modusers)
{
if(isset($modusers['users'][$uid]) && $modusers['users'][$uid]['mid'])

				foreach($modcache as $modusers)
{
if(isset($modusers['users'][$uid]) && $modusers['users'][$uid]['mid'])

					{
return true;

					{
return true;

					}
elseif(isset($modusers['usergroups'][$user_perms['gid']]))
{
// Moderating usergroup
return true;

					}
elseif(isset($modusers['usergroups'][$user_perms['gid']]))
{
// Moderating usergroup
return true;

					}
}

					}
}

			}
return false;
}

			}
return false;
}

Zeile 1592Zeile 1601
					return false;
}
}

					return false;
}
}

		}
}
}

		}
}
}


/**
* Generate a list of the posticons.


/**
* Generate a list of the posticons.

Zeile 1665Zeile 1674
	if(!$mybb->settings['cookiepath'])
{
$mybb->settings['cookiepath'] = "/";

	if(!$mybb->settings['cookiepath'])
{
$mybb->settings['cookiepath'] = "/";

	}


	}


	if($expires == -1)

	if($expires == -1)

	{

	{

		$expires = 0;

		$expires = 0;

	}

	}

	elseif($expires == "" || $expires == null)
{
$expires = TIME_NOW + (60*60*24*365); // Make the cookie expire in a years time

	elseif($expires == "" || $expires == null)
{
$expires = TIME_NOW + (60*60*24*365); // Make the cookie expire in a years time

Zeile 1678Zeile 1687
	else
{
$expires = TIME_NOW + intval($expires);

	else
{
$expires = TIME_NOW + intval($expires);

	}


	}


	$mybb->settings['cookiepath'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiepath']);
$mybb->settings['cookiedomain'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiedomain']);
$mybb->settings['cookieprefix'] = str_replace(array("\n","\r", " "), "", $mybb->settings['cookieprefix']);

	$mybb->settings['cookiepath'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiepath']);
$mybb->settings['cookiedomain'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiedomain']);
$mybb->settings['cookieprefix'] = str_replace(array("\n","\r", " "), "", $mybb->settings['cookieprefix']);

Zeile 1690Zeile 1699
	if($expires > 0)
{
$cookie .= "; expires=".@gmdate('D, d-M-Y H:i:s \\G\\M\\T', $expires);

	if($expires > 0)
{
$cookie .= "; expires=".@gmdate('D, d-M-Y H:i:s \\G\\M\\T', $expires);

	}


	}


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

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

	{

	{

		$cookie .= "; path={$mybb->settings['cookiepath']}";

		$cookie .= "; path={$mybb->settings['cookiepath']}";

	}


	}


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

if($httponly == true)

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

if($httponly == true)

	{

	{

		$cookie .= "; HttpOnly";
}

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

		$cookie .= "; HttpOnly";
}

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





	header($cookie, false);
}

/**
* Unset a cookie set by MyBB.

	header($cookie, false);
}

/**
* Unset a cookie set by MyBB.

 *
* @param string The cookie identifier.

 *
* @param string The cookie identifier.

 */
function my_unsetcookie($name)
{
global $mybb;

 */
function my_unsetcookie($name)
{
global $mybb;





	$expires = -3600;
my_setcookie($name, "", $expires);

	$expires = -3600;
my_setcookie($name, "", $expires);





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

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

}

/**

}

/**

 * Get the contents from a serialised cookie array.
*
* @param string The cookie identifier.

 * Get the contents from a serialised cookie array.
*
* @param string The cookie identifier.

Zeile 1739Zeile 1748
	global $mybb;

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

	global $mybb;

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

	{

	{

		return false;
}


		return false;
}


Zeile 1763Zeile 1772
 * @param string The value to set the cookie to.
*/
function my_set_array_cookie($name, $id, $value, $expires="")

 * @param string The value to set the cookie to.
*/
function my_set_array_cookie($name, $id, $value, $expires="")

{

{

	global $mybb;

$cookie = $mybb->cookies['mybb'];

	global $mybb;

$cookie = $mybb->cookies['mybb'];

Zeile 1784Zeile 1793
 * @return array Unserialized data array
*/
function my_unserialize($data)

 * @return array Unserialized data array
*/
function my_unserialize($data)

{

{

	$array = unserialize($data);

if(!is_array($array))

	$array = unserialize($data);

if(!is_array($array))

Zeile 1850Zeile 1859
			if(!is_array($serverload))
{
return $lang->unknown;

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

			}
}
}
else
{
return $lang->unknown;
}

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


			}
}
}
else
{
return $lang->unknown;
}

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


	return $returnload;
}


	return $returnload;
}


Zeile 1920Zeile 1929

// Fetch latest user if the user count is changing
if(array_key_exists('numusers', $changes))


// Fetch latest user if the user count is changing
if(array_key_exists('numusers', $changes))

	{

	{

		$query = $db->simple_select("users", "uid, username", "", array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit' => 1));
$lastmember = $db->fetch_array($query);
$new_stats['lastuid'] = $lastmember['uid'];

		$query = $db->simple_select("users", "uid, username", "", array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit' => 1));
$lastmember = $db->fetch_array($query);
$new_stats['lastuid'] = $lastmember['uid'];

Zeile 1955Zeile 1964

/**
* Updates the forum counters with a specific value (or addition/subtraction of the previous value)


/**
* Updates the forum counters with a specific value (or addition/subtraction of the previous value)

 *
* @param int The forum ID

 *
* @param int The forum ID

 * @param array Array of items being updated (threads, posts, unapprovedthreads, unapprovedposts) and their value (ex, 1, +1, -1)
*/
function update_forum_counters($fid, $changes=array())

 * @param array Array of items being updated (threads, posts, unapprovedthreads, unapprovedposts) and their value (ex, 1, +1, -1)
*/
function update_forum_counters($fid, $changes=array())

Zeile 2149Zeile 2158

/**
* Update the first post and lastpost data for a specific thread


/**
* Update the first post and lastpost data for a specific thread

 *

 *

 * @param int The thread ID
*/
function update_thread_data($tid)

 * @param int The thread ID
*/
function update_thread_data($tid)

Zeile 2160Zeile 2169

// If this is a moved thread marker, don't update it - we need it to stay as it is
if(strpos($thread['closed'], 'moved|') !== false)


// If this is a moved thread marker, don't update it - we need it to stay as it is
if(strpos($thread['closed'], 'moved|') !== false)

	{

	{

		return false;
}


		return false;
}


Zeile 2171Zeile 2180
		WHERE p.tid='$tid' AND p.visible='1'
ORDER BY p.dateline DESC
LIMIT 1"

		WHERE p.tid='$tid' AND p.visible='1'
ORDER BY p.dateline DESC
LIMIT 1"

	);

	);

	$lastpost = $db->fetch_array($query);

$db->free_result($query);

	$lastpost = $db->fetch_array($query);

$db->free_result($query);

Zeile 2194Zeile 2203
	}

if(!$lastpost['username'])

	}

if(!$lastpost['username'])

	{

	{

		$lastpost['username'] = $lastpost['postusername'];
}


		$lastpost['username'] = $lastpost['postusername'];
}


Zeile 2217Zeile 2226
		'lastposteruid' => intval($lastpost['uid']),
);
$db->update_query("threads", $update_array, "tid='{$tid}'");

		'lastposteruid' => intval($lastpost['uid']),
);
$db->update_query("threads", $update_array, "tid='{$tid}'");





	unset($firstpost, $lastpost, $update_array);

	unset($firstpost, $lastpost, $update_array);

}

}


function update_forum_count($fid)


function update_forum_count($fid)

{

{

	die("Deprecated function call: update_forum_count");
}
function update_thread_count($tid)
{
die("Deprecated function call: update_thread_count");

	die("Deprecated function call: update_forum_count");
}
function update_thread_count($tid)
{
die("Deprecated function call: update_thread_count");

}

}

function update_thread_attachment_count($tid)

function update_thread_attachment_count($tid)

{

{

	die("Deprecated function call: update_thread_attachment_count");
}

	die("Deprecated function call: update_thread_attachment_count");
}





/**
* Deletes a thread from the database
*
* @param int The thread ID
*/
function delete_thread($tid)

/**
* Deletes a thread from the database
*
* @param int The thread ID
*/
function delete_thread($tid)

{
global $moderation;

if(!is_object($moderation))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;
}

{
global $moderation;

if(!is_object($moderation))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;
}


return $moderation->delete_thread($tid);
}


return $moderation->delete_thread($tid);
}

Zeile 2258Zeile 2267
 * @param int The thread ID
*/
function delete_post($pid, $tid="")

 * @param int The thread ID
*/
function delete_post($pid, $tid="")

{

{

	global $moderation;

if(!is_object($moderation))

	global $moderation;

if(!is_object($moderation))

Zeile 2293Zeile 2302
	if($permissions)
{
$permissions = $mybb->usergroup;

	if($permissions)
{
$permissions = $mybb->usergroup;

	}


	}


	if(!is_array($jumpfcache))
{
if(!is_array($forum_cache))

	if(!is_array($jumpfcache))
{
if(!is_array($forum_cache))

Zeile 2342Zeile 2351
					{
$newdepth = $depth."--";
$forumjumpbits .= build_forum_jump($forum['fid'], $selitem, 0, $newdepth, $showextras, $showall);

					{
$newdepth = $depth."--";
$forumjumpbits .= build_forum_jump($forum['fid'], $selitem, 0, $newdepth, $showextras, $showall);

					}

					}

				}
}
}

				}
}
}

Zeile 2536Zeile 2545
	}

return $codeinsert;

	}

return $codeinsert;

}

}


/**
* Build the javascript clickable smilie inserter


/**
* Build the javascript clickable smilie inserter

Zeile 2548Zeile 2557
	global $cache, $smiliecache, $theme, $templates, $lang, $mybb, $smiliecount;

if($mybb->settings['smilieinserter'] != 0 && $mybb->settings['smilieinsertercols'] && $mybb->settings['smilieinsertertot'])

	global $cache, $smiliecache, $theme, $templates, $lang, $mybb, $smiliecount;

if($mybb->settings['smilieinserter'] != 0 && $mybb->settings['smilieinsertercols'] && $mybb->settings['smilieinsertertot'])

	{

	{

		if(!$smiliecount)

		if(!$smiliecount)

		{

		{

			$smilie_cache = $cache->read("smilies");
$smiliecount = count($smilie_cache);
}

			$smilie_cache = $cache->read("smilies");
$smiliecount = count($smilie_cache);
}

Zeile 2560Zeile 2569
			if(!is_array($smilie_cache))
{
$smilie_cache = $cache->read("smilies");

			if(!is_array($smilie_cache))
{
$smilie_cache = $cache->read("smilies");

			}

			}

			foreach($smilie_cache as $smilie)
{
if($smilie['showclickable'] != 0)

			foreach($smilie_cache as $smilie)
{
if($smilie['showclickable'] != 0)

Zeile 2596Zeile 2605
				if($i < $mybb->settings['smilieinsertertot'])
{
if($counter == 0)

				if($i < $mybb->settings['smilieinsertertot'])
{
if($counter == 0)

					{

					{

						$smilies .=  "<tr>\n";
}


						$smilies .=  "<tr>\n";
}


Zeile 2620Zeile 2629
			}

eval("\$clickablesmilies = \"".$templates->get("smilieinsert")."\";");

			}

eval("\$clickablesmilies = \"".$templates->get("smilieinsert")."\";");

		}

		}

		else
{
$clickablesmilies = "";
}

		else
{
$clickablesmilies = "";
}

	}

	}

	else
{
$clickablesmilies = "";
}

return $clickablesmilies;

	else
{
$clickablesmilies = "";
}

return $clickablesmilies;

}

}


/**
* Builds thread prefixes and returns a selected prefix (or all)


/**
* Builds thread prefixes and returns a selected prefix (or all)

Zeile 2669Zeile 2678
	}

$prefixes_cache = array();

	}

$prefixes_cache = array();

	foreach($prefix_cache as $prefix)

	foreach($prefix_cache as $prefix)

	{
$prefixes_cache[$prefix['pid']] = $prefix;

	{
$prefixes_cache[$prefix['pid']] = $prefix;

	}

	}


if($pid != 0 && is_array($prefixes_cache[$pid]))


if($pid != 0 && is_array($prefixes_cache[$pid]))

	{

	{

		return $prefixes_cache[$pid];
}
else if(!empty($prefixes_cache))
{
return $prefixes_cache;

		return $prefixes_cache[$pid];
}
else if(!empty($prefixes_cache))
{
return $prefixes_cache;

	}

	}


return false;
}


return false;
}

Zeile 2729Zeile 2738
			$forums = explode(",", $prefix['forums']);

if(!in_array($fid, $forums))

			$forums = explode(",", $prefix['forums']);

if(!in_array($fid, $forums))

			{

			{

				// This prefix is not in our forum list
continue;

				// This prefix is not in our forum list
continue;

			}
}

if($prefix['groups'] != "-1")
{
$prefix_groups = explode(",", $prefix['groups']);

			}
}

if($prefix['groups'] != "-1")
{
$prefix_groups = explode(",", $prefix['groups']);


foreach($groups as $group)
{


foreach($groups as $group)
{

Zeile 2747Zeile 2756
					$prefixes[$prefix['pid']] = $prefix;
}
}

					$prefixes[$prefix['pid']] = $prefix;
}
}

		}

		}

		else
{
// This prefix is for anybody to use...

		else
{
// This prefix is for anybody to use...

Zeile 2756Zeile 2765
	}

if(empty($prefixes))

	}

if(empty($prefixes))

	{

	{

		return false;
}

$prefixselect = "";

		return false;
}

$prefixselect = "";

	$multipleselect = "";

 
	if($multiple != 0)
{

	if($multiple != 0)
{

		$multipleselect = " multiple=\"multiple\" size=\"5\"";





		$prefixselect = "<select name=\"threadprefix[]\" multiple=\"multiple\" size=\"5\">\n";
}
else
{
$prefixselect = "<select name=\"threadprefix\">\n";

	}

	}


$prefixselect = "<select name=\"threadprefix\"{$multipleselect}>\n";

 

if($multiple == 1)
{


if($multiple == 1)
{

Zeile 2923Zeile 2933
	if($uid != 0)
{
$display_reputation = "<a href=\"reputation.php?uid={$uid}\">";

	if($uid != 0)
{
$display_reputation = "<a href=\"reputation.php?uid={$uid}\">";

	}

$display_reputation .= "<strong class=\"";

	}

$display_reputation .= "<strong class=\"";


if($reputation < 0)
{


if($reputation < 0)
{

Zeile 2987Zeile 2997

$ip = 0;



$ip = 0;


	if(!preg_match("#^(10|172\.16|192\.168)\.#", $_SERVER['REMOTE_ADDR']))

	if(!preg_match("#^(10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\.#", $_SERVER['REMOTE_ADDR']))

	{
$ip = $_SERVER['REMOTE_ADDR'];
}

	{
$ip = $_SERVER['REMOTE_ADDR'];
}

Zeile 3007Zeile 3017
		{
foreach($addresses[0] as $key => $val)
{

		{
foreach($addresses[0] as $key => $val)
{

				if(!preg_match("#^(10|172\.16|192\.168)\.#", $val))

				if(!preg_match("#^(10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\.#", $val))

				{
$ip = $val;
break;

				{
$ip = $val;
break;

Zeile 3118Zeile 3128
	$ext = my_strtolower($ext);

if($attachtypes[$ext]['icon'])

	$ext = my_strtolower($ext);

if($attachtypes[$ext]['icon'])

	{
if(defined("IN_ADMINCP"))
{

	{
if(defined("IN_ADMINCP"))
{

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

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

Zeile 5440Zeile 5450
			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 5634Zeile 5644
	}

if(function_exists("curl_init"))

	}

if(function_exists("curl_init"))

	{

	{

		$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);

		$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);

Zeile 5680Zeile 5690
			$headers[] = "POST {$url['path']} HTTP/1.0";
$headers[] = "Content-Length: ".strlen($post_body);
$headers[] = "Content-Type: application/x-www-form-urlencoded";

			$headers[] = "POST {$url['path']} HTTP/1.0";
$headers[] = "Content-Length: ".strlen($post_body);
$headers[] = "Content-Type: application/x-www-form-urlencoded";

		}
else
{

		}
else
{

			$headers[] = "GET {$url['path']} HTTP/1.0";
}


			$headers[] = "GET {$url['path']} HTTP/1.0";
}


Zeile 5730Zeile 5740
 * @return boolean True if a super admin, false if not
*/
function is_super_admin($uid)

 * @return boolean True if a super admin, false if not
*/
function is_super_admin($uid)

{
global $mybb;

$mybb->config['super_admins'] = str_replace(" ", "", $mybb->config['super_admins']);
if(my_strpos(",{$mybb->config['super_admins']},", ",{$uid},") === false)
{






{
static $super_admins;

if(!isset($super_admins))
{
global $mybb;
$super_admins = str_replace(" ", "", $mybb->config['super_admins']);
}

if(my_strpos(",{$super_admins},", ",{$uid},") === false)
{

		return false;

		return false;

	}

	}

	else

	else

	{

	{

		return true;
}

		return true;
}

 
}

/**
* Prevents super administrators being selected in a SELECT.
*
* @param boolean Prefix with an AND?
* @param string The prefix to add to uid when used in a JOIN (e.g. SELECTing users u would mean using 'u' in this argument).
* @return string An addition to the WHERE statement
*/
function not_super_admins($use_and = false, $uid_prefix = '')
{
static $super_admins;

if(!isset($super_admins))
{
global $mybb, $db;
$super_admins = $db->escape_string(str_replace(" ", "", $mybb->config['super_admins']));
}

if($super_admins)
{
$sql_where = '';
if($use_and)
{
$sql_where .= ' AND ';
}

if($uid_prefix != '')
{
$sql_where .= $uid_prefix.'.';
}

$sql_where .= "uid NOT IN({$super_admins})";

return $sql_where;
}
return '';

}

/**

}

/**

Zeile 5769Zeile 5821
			$escape_preg = "(".implode("|", array_map("escaped_explode_escape", $escape)).")";
}
else

			$escape_preg = "(".implode("|", array_map("escaped_explode_escape", $escape)).")";
}
else

		{

		{

			$escape_preg = preg_quote($escape, "#");
}
$quoted_strings = preg_split("#(?<!\\\){$escape_preg}#", $string);
}
else

			$escape_preg = preg_quote($escape, "#");
}
$quoted_strings = preg_split("#(?<!\\\){$escape_preg}#", $string);
}
else

	{

	{

		$quoted_strings = array($string);
}
foreach($quoted_strings as $string)
{
if($string != "")

		$quoted_strings = array($string);
}
foreach($quoted_strings as $string)
{
if($string != "")

		{

		{

			if($in_escape)
{
$strings[] = trim($string);

			if($in_escape)
{
$strings[] = trim($string);

Zeile 5817Zeile 5869
	$ip_string1 = $ip_string2 = "";

if($ip == "*")

	$ip_string1 = $ip_string2 = "";

if($ip == "*")

	{

	{

		return array(my_ip2long('128.0.0.0'), my_ip2long('127.255.255.255'));
}


		return array(my_ip2long('128.0.0.0'), my_ip2long('127.255.255.255'));
}


Zeile 5825Zeile 5877
	{
$ip = str_replace("*", "", $ip);
if(count($ip_bits) == 4)

	{
$ip = str_replace("*", "", $ip);
if(count($ip_bits) == 4)

		{

		{

			return my_ip2long($ip);

			return my_ip2long($ip);

		}
else
{

		}
else
{

			return array(my_ip2long($ip.".0"), my_ip2long($ip.".255"));
}
}

			return array(my_ip2long($ip.".0"), my_ip2long($ip.".255"));
}
}

Zeile 6021Zeile 6073
	}

return @unlink($path);

	}

return @unlink($path);

}


}


/**
* Counts the number of subforums in a array([pid][disporder][fid]) starting from the pid
*

/**
* Counts the number of subforums in a array([pid][disporder][fid]) starting from the pid
*

Zeile 6209Zeile 6261
function secure_seed_rng($count=8)
{
$output = '';

function secure_seed_rng($count=8)
{
$output = '';


// Use OpenSSL when available
// PHP <5.3.4 had a bug which makes that function unusable on Windows
if(function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>='))
{
$output = openssl_random_pseudo_bytes($count);















	// DIRECTORY_SEPARATOR checks if running windows
if(DIRECTORY_SEPARATOR != '\\')
{
// Unix/Linux
// Use OpenSSL when available
if(function_exists('openssl_random_pseudo_bytes'))
{
$output = openssl_random_pseudo_bytes($count);
}
// Try mcrypt
elseif(function_exists('mcrypt_create_iv'))
{
$output = mcrypt_create_iv($count, MCRYPT_DEV_URANDOM);
}
// Try /dev/urandom
elseif(@is_readable('/dev/urandom') && ($handle = @fopen('/dev/urandom', 'rb')))
{
$output = @fread($handle, $count);
@fclose($handle);
}

	}

	}

	// Try the unix/linux method
elseif(@is_readable('/dev/urandom') && ($handle = @fopen('/dev/urandom', 'rb')))

	else


	{

	{

		$output = @fread($handle, $count);
@fclose($handle);
}
// Try Windows CAPICOM before using our own generator
elseif(class_exists('COM'))
{
try

		// Windows
// Use OpenSSL when available
// PHP <5.3.4 had a bug which makes that function unusable on Windows
if(function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>='))




		{

		{

			$CAPI_Util = new COM('CAPICOM.Utilities.1');
$output = $CAPI_Util->GetRandom($count, 0);
} catch (Exception $ex) {

















			$output = openssl_random_pseudo_bytes($count);
}
// Try mcrypt
elseif(function_exists('mcrypt_create_iv'))
{
$output = mcrypt_create_iv($count, MCRYPT_RAND);
}
// Try Windows CAPICOM before using our own generator
elseif(class_exists('COM'))
{
try
{
$CAPI_Util = new COM('CAPICOM.Utilities.1');
if(is_callable(array($CAPI_Util, 'GetRandom')))
{
$output = $CAPI_Util->GetRandom($count, 0);
}
} catch (Exception $e) {
}

		}
}


		}
}