phpBB

Code Changes

File: includes/functions_convert.php

  Unmodified   Added   Modified   Removed
Line 205Line 205

/**
* Generate the email hash stored in the users table


/**
* Generate the email hash stored in the users table

 
*
* Note: Deprecated, calls should directly go to phpbb_email_hash()

*/
function gen_email_hash($email)
{

*/
function gen_email_hash($email)
{

	return (crc32(strtolower($email)) . strlen($email));

	return phpbb_email_hash($email);

}

/**

}

/**

Line 422Line 424

$relative_path = empty($convert->convertor['source_path_absolute']);



$relative_path = empty($convert->convertor['source_path_absolute']);


	if (empty($convert->convertor['avatar_gallery_path']))


	// check for trailing slash
if (rtrim($convert->convertor['avatar_gallery_path'], '/') === '')

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

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

Line 551Line 554
	);

// copy file will prepend $phpBB_root_path

	);

// copy file will prepend $phpBB_root_path

	$target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target);

	$target = $config[$config_var] . '/' . utf8_basename(($use_target === false) ? $source : $use_target);


if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
{


if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
{

Line 567Line 570

if ($result['copied'])
{


if ($result['copied'])
{

		$result['target'] = basename($target);

		$result['target'] = utf8_basename($target);

	}
else
{

	}
else
{

		$result['target'] = ($use_target !== false) ? $result['orig_source'] : basename($target);

		$result['target'] = ($use_target !== false) ? $result['orig_source'] : utf8_basename($target);

	}

return $result;

	}

return $result;

Line 586Line 589

global $convert, $phpbb_root_path, $config, $user;



global $convert, $phpbb_root_path, $config, $user;


	if (empty($convert->convertor['upload_path']))


	// check for trailing slash
if (rtrim($convert->convertor['upload_path'], '/') === '')

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

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

Line 600Line 604
		{
$thumb_dir = $convert->convertor['thumbnails'][0];
$thumb_prefix = $convert->convertor['thumbnails'][1];

		{
$thumb_dir = $convert->convertor['thumbnails'][0];
$thumb_prefix = $convert->convertor['thumbnails'][1];

			$thumb_source = $thumb_dir . $thumb_prefix . basename($result['source']);

			$thumb_source = $thumb_dir . $thumb_prefix . utf8_basename($result['source']);


if (strpos($thumb_source, $convert->convertor['upload_path']) !== 0)
{


if (strpos($thumb_source, $convert->convertor['upload_path']) !== 0)
{

Line 645Line 649

global $convert, $phpbb_root_path, $config, $user;



global $convert, $phpbb_root_path, $config, $user;


	if (!isset($convert->convertor['smilies_path']))


	// check for trailing slash
if (rtrim($convert->convertor['smilies_path'], '/') === '')

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

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

Line 665Line 670

global $convert, $phpbb_root_path, $config, $user;



global $convert, $phpbb_root_path, $config, $user;


	if (!isset($convert->convertor['avatar_path']))


	// check for trailing slash
if (rtrim($convert->convertor['avatar_path'], '/') === '')

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

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

Line 1023Line 1029
		'bbcode'		=> array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
'popuppm' => array('bit' => 10, 'default' => 0),

		'bbcode'		=> array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
'popuppm' => array('bit' => 10, 'default' => 0),

 
		'sig_bbcode'	=> array('bit' => 15, 'default' => 1),
'sig_smilies' => array('bit' => 16, 'default' => 1),
'sig_links' => array('bit' => 17, 'default' => 1),

	);

$option_field = 0;

	);

$option_field = 0;

Line 1230Line 1239
		if (!file_exists($filename))
{
$convert->p_master->error($user->lang['FILE_NOT_FOUND'] . ': ' . $filename, __LINE__, __FILE__);

		if (!file_exists($filename))
{
$convert->p_master->error($user->lang['FILE_NOT_FOUND'] . ': ' . $filename, __LINE__, __FILE__);

 
		}

if (isset($convert->config_schema['array_name']))
{
unset($convert->config_schema['array_name']);

		}

$convert_config = extract_variables_from_file($filename);

		}

$convert_config = extract_variables_from_file($filename);

Line 1264Line 1278
	global $db, $config;

$convert_config = get_config();

	global $db, $config;

$convert_config = get_config();

 


	foreach ($schema['settings'] as $config_name => $src)
{
if (preg_match('/(.*)\((.*)\)/', $src, $m))

	foreach ($schema['settings'] as $config_name => $src)
{
if (preg_match('/(.*)\((.*)\)/', $src, $m))

Line 1273Line 1288
			eval($exec);
}
else

			eval($exec);
}
else

 
		{
if ($schema['table_format'] != 'file' || empty($schema['array_name']))

		{
$config_value = (isset($convert_config[$src])) ? $convert_config[$src] : '';

		{
$config_value = (isset($convert_config[$src])) ? $convert_config[$src] : '';

 
			}
else if (!empty($schema['array_name']))
{
$src_ary = $schema['array_name'];
$config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : '';
}

		}

if ($config_value !== '')

		}

if ($config_value !== '')

Line 1629Line 1652

case 'mssql':
case 'sqlite':


case 'mssql':
case 'sqlite':

 
					case 'mssqlnative':

						$sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary));
break;


						$sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary));
break;


Line 1698Line 1722
		'REGISTERED_COPPA'	=> array('', 0, 0),
'GLOBAL_MODERATORS' => array('00AA00', 1, 0),
'ADMINISTRATORS' => array('AA0000', 1, 1),

		'REGISTERED_COPPA'	=> array('', 0, 0),
'GLOBAL_MODERATORS' => array('00AA00', 1, 0),
'ADMINISTRATORS' => array('AA0000', 1, 1),

		'BOTS'				=> array('9E8DA7', 0, 0)


		'BOTS'				=> array('9E8DA7', 0, 0),
'NEWLY_REGISTERED' => array('', 0, 0),

	);

$sql = 'SELECT *

	);

$sql = 'SELECT *

Line 1744Line 1769
	$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_postcount = 1

	$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_postcount = 1

 
				AND post_approved = 1

			GROUP BY poster_id
ORDER BY poster_id';
$result = $db->sql_query_limit($sql, $limit, $offset);

			GROUP BY poster_id
ORDER BY poster_id';
$result = $db->sql_query_limit($sql, $limit, $offset);

Line 1794Line 1820
		'Alta Vista [Bot]'			=> array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'Baidu [Spider]' => array('Baiduspider+(', ''),

		'Alta Vista [Bot]'			=> array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'Baidu [Spider]' => array('Baiduspider+(', ''),

 
		'Bing [Bot]'				=> array('bingbot/', ''),

		'Exabot [Bot]'				=> array('Exabot/', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),

		'Exabot [Bot]'				=> array('Exabot/', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),

Line 1951Line 1978
		FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);

		FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);

	set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true);

	set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);

	$db->sql_freeresult($result);

/**

	$db->sql_freeresult($result);

/**

Line 2255Line 2282

if (substr($trg, -1) == '/')
{


if (substr($trg, -1) == '/')
{

		$trg .= basename($src);

		$trg .= utf8_basename($src);

	}
$src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
$trg_path = $trg;

	}
$src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
$trg_path = $trg;

Line 2284Line 2311
		}
}


		}
}


	if (!is_writable($path))

	if (!phpbb_is_writable($path))

	{
@chmod($path, 0777);
}

	{
@chmod($path, 0777);
}

Line 2319Line 2346
		@chmod($trg_path, 0777);
}


		@chmod($trg_path, 0777);
}


	if (!@is_writable($trg_path))

	if (!phpbb_is_writable($trg_path))

	{
$bad_dirs[] = path($config['script_path']) . $trg;
}

	{
$bad_dirs[] = path($config['script_path']) . $trg;
}

Line 2386Line 2413
				@chmod($trg_path . $dir, 0777);
}


				@chmod($trg_path . $dir, 0777);
}


			if (!@is_writable($trg_path . $dir))

			if (!phpbb_is_writable($trg_path . $dir))

			{
$bad_dirs[] = $trg . $dir;
$bad_dirs[] = $trg_path . $dir;

			{
$bad_dirs[] = $trg . $dir;
$bad_dirs[] = $trg_path . $dir;