phpBB

Code Changes

File: includes/functions_convert.php

  Unmodified   Added   Modified   Removed
Line 192Line 192
		$db->sql_freeresult($result);
}


		$db->sql_freeresult($result);
}


	if (!sizeof($group_mapping))

	if (!count($group_mapping))

	{
add_default_groups();
return get_group_id($group_name);

	{
add_default_groups();
return get_group_id($group_name);

Line 249Line 249
	{
return '';
}

	{
return '';
}

	else if (!preg_match('#^[a-z0-9]+://#i', $url) && strlen($url) > 0)

	else if (!preg_match('#^http[s]?://#i', $url) && strlen($url) > 0)

	{
return 'http://' . $url;
}

	{
return 'http://' . $url;
}

Line 307Line 307
	$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));

// Any mod changing the way ips are stored? Then we are not able to convert and enter the ip "as is" to not "destroy" anything...

	$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));

// Any mod changing the way ips are stored? Then we are not able to convert and enter the ip "as is" to not "destroy" anything...

	if (sizeof($hexipbang) < 4)

	if (count($hexipbang) < 4)

	{
return $int_ip;
}

	{
return $int_ip;
}

Line 479Line 479
				$dir->close();
}


				$dir->close();
}


			for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i)

			for ($i = 0, $end = count($dirlist); $i < $end; ++$i)

			{
$dir = $dirlist[$i];


			{
$dir = $dirlist[$i];


Line 1261Line 1261
		}
}


		}
}


	if (!sizeof($convert_config))

	if (!count($convert_config))

	{
$convert->p_master->error($user->lang['CONV_ERROR_CONFIG_EMPTY'], __LINE__, __FILE__);
}

	{
$convert->p_master->error($user->lang['CONV_ERROR_CONFIG_EMPTY'], __LINE__, __FILE__);
}

Line 1406Line 1406
		$url_parts = explode('/', $m[2]);
if (substr($src_url, -1) != '/')
{

		$url_parts = explode('/', $m[2]);
if (substr($src_url, -1) != '/')
{

			if (preg_match('/.*\.([a-z0-9]{3,4})$/i', $url_parts[sizeof($url_parts) - 1]))

			if (preg_match('/.*\.([a-z0-9]{3,4})$/i', $url_parts[count($url_parts) - 1]))

			{

			{

				$url_parts[sizeof($url_parts) - 1] = '';

				$url_parts[count($url_parts) - 1] = '';

			}
else
{

			}
else
{

Line 1425Line 1425
		$path_array = array();

$phpbb_parts = explode('/', $script_path);

		$path_array = array();

$phpbb_parts = explode('/', $script_path);

		for ($i = 0, $end = sizeof($url_parts); $i < $end; ++$i)

		for ($i = 0, $end = count($url_parts); $i < $end; ++$i)

		{

		{

			if ($i < sizeof($phpbb_parts[$i]) && $url_parts[$i] == $phpbb_parts[$i])

			if ($i < count($phpbb_parts[$i]) && $url_parts[$i] == $phpbb_parts[$i])

			{
$path_array[] = $url_parts[$i];
unset($url_parts[$i]);

			{
$path_array[] = $url_parts[$i];
unset($url_parts[$i]);

Line 1435Line 1435
			else
{
$path = '';

			else
{
$path = '';

				for ($j = $i, $end2 = sizeof($phpbb_parts); $j < $end2; ++$j)

				for ($j = $i, $end2 = count($phpbb_parts); $j < $end2; ++$j)

				{
$path .= '../';
}

				{
$path .= '../';
}

Line 1458Line 1458

function compare_table($tables, $tablename, &$prefixes)
{


function compare_table($tables, $tablename, &$prefixes)
{

	for ($i = 0, $table_size = sizeof($tables); $i < $table_size; ++$i)

	for ($i = 0, $table_size = count($tables); $i < $table_size; ++$i)

	{
if (preg_match('/(.*)' . $tables[$i] . '$/', $tablename, $m))
{

	{
if (preg_match('/(.*)' . $tables[$i] . '$/', $tablename, $m))
{

Line 1754Line 1754
		);
}


		);
}


	if (sizeof($sql_ary))

	if (count($sql_ary))

	{
$db->sql_multi_insert(GROUPS_TABLE, $sql_ary);
}

	{
$db->sql_multi_insert(GROUPS_TABLE, $sql_ary);
}

Line 1786Line 1786
	}
$db->sql_freeresult($result);


	}
$db->sql_freeresult($result);


	if (sizeof($teampage_ary))

	if (count($teampage_ary))

	{
$db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_ary);
}

	{
$db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_ary);
}

Line 2101Line 2101
		}
unset($posted);


		}
unset($posted);


		if (sizeof($sql_ary))

		if (count($sql_ary))

		{
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
}

		{
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
}

Line 2136Line 2136
	}
$db->sql_freeresult($result);


	}
$db->sql_freeresult($result);


	if (sizeof($user_ids))

	if (count($user_ids))

	{
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('administrators') . '
WHERE group_id = 0 AND ' . $db->sql_in_set('user_id', $user_ids));

	{
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('administrators') . '
WHERE group_id = 0 AND ' . $db->sql_in_set('user_id', $user_ids));

Line 2152Line 2152
	}
$db->sql_freeresult($result);


	}
$db->sql_freeresult($result);


	if (sizeof($user_ids))

	if (count($user_ids))

	{
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('global_moderators') . '
WHERE group_id = 0 AND ' . $db->sql_in_set('user_id', $user_ids));

	{
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('global_moderators') . '
WHERE group_id = 0 AND ' . $db->sql_in_set('user_id', $user_ids));

Line 2264Line 2264
			"\n\n"
);


			"\n\n"
);


		for ($i = 0, $end = sizeof($str_from); $i < $end; ++$i)

		for ($i = 0, $end = count($str_from); $i < $end; ++$i)

		{
$origx[] = '#\\' . str_replace(']', '\\]', $str_from[$i]) . '#is';
$replx[] = $str_to[$i];

		{
$origx[] = '#\\' . str_replace(']', '\\]', $str_from[$i]) . '#is';
$replx[] = $str_to[$i];

Line 2273Line 2273

if (preg_match_all('#\[email=([^\]]+)\](.*?)\[/email\]#i', $message, $m))
{


if (preg_match_all('#\[email=([^\]]+)\](.*?)\[/email\]#i', $message, $m))
{

		for ($i = 0, $end = sizeof($m[1]); $i < $end; ++$i)

		for ($i = 0, $end = count($m[1]); $i < $end; ++$i)

		{
if ($m[1][$i] == $m[2][$i])
{

		{
if ($m[1][$i] == $m[2][$i])
{

Line 2292Line 2292
		$message = preg_replace('#\[size=([0-9]+)\](.*?)\[/size\]#i', '[size=\1]\2[/size]', $message);
$message = preg_replace('#\[size=[0-9]{2,}\](.*?)\[/size\]#i', '[size=29]\1[/size]', $message);


		$message = preg_replace('#\[size=([0-9]+)\](.*?)\[/size\]#i', '[size=\1]\2[/size]', $message);
$message = preg_replace('#\[size=[0-9]{2,}\](.*?)\[/size\]#i', '[size=29]\1[/size]', $message);


		for ($i = sizeof($size); $i;)

		for ($i = count($size); $i;)

		{
$i--;
$message = str_replace('[size=' . $i . ']', '[size=' . $size[$i] . ']', $message);

		{
$i--;
$message = str_replace('[size=' . $i . ']', '[size=' . $size[$i] . ']', $message);

Line 2335Line 2335

$path = $phpbb_root_path;
$parts = explode('/', $trg);


$path = $phpbb_root_path;
$parts = explode('/', $trg);

	unset($parts[sizeof($parts) - 1]);

	unset($parts[count($parts) - 1]);





	for ($i = 0, $end = sizeof($parts); $i < $end; ++$i)

	for ($i = 0, $end = count($parts); $i < $end; ++$i)

	{
$path .= $parts[$i] . '/';


	{
$path .= $parts[$i] . '/';


Line 2437Line 2437

if ($copy_subdirs)
{


if ($copy_subdirs)
{

		for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i)

		for ($i = 0, $end = count($dirlist); $i < $end; ++$i)

		{
$dir = $dirlist[$i];


		{
$dir = $dirlist[$i];


Line 2458Line 2458
				$bad_dirs[] = $trg_path . $dir;
}


				$bad_dirs[] = $trg_path . $dir;
}


			if (!sizeof($bad_dirs))

			if (!count($bad_dirs))

			{
copy_dir($src . $dir, $trg . $dir, true, $overwrite, $die_on_failure, $source_relative_path);
}
}
}


			{
copy_dir($src . $dir, $trg . $dir, true, $overwrite, $die_on_failure, $source_relative_path);
}
}
}


	if (sizeof($bad_dirs))

	if (count($bad_dirs))

	{

	{

		$str = (sizeof($bad_dirs) == 1) ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE'];

		$str = (count($bad_dirs) == 1) ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE'];

		sort($bad_dirs);
$convert->p_master->error(sprintf($str, implode('<br />', $bad_dirs)), __LINE__, __FILE__);
}


		sort($bad_dirs);
$convert->p_master->error(sprintf($str, implode('<br />', $bad_dirs)), __LINE__, __FILE__);
}


	for ($i = 0, $end = sizeof($filelist); $i < $end; ++$i)

	for ($i = 0, $end = count($filelist); $i < $end; ++$i)

	{
copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path);
}

	{
copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path);
}