Vergleich install/index.php - 1.6.4 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: index.php 5404 2011-03-19 01:17:10Z jammerx2 $

 * $Id$

 */

if(function_exists("unicode_decode"))

 */

if(function_exists("unicode_decode"))

Zeile 1385Zeile 1385
	
if(strstr($mybb->input['dbengine'], "sqlite") !== false)
{

	
if(strstr($mybb->input['dbengine'], "sqlite") !== false)
{

		if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false)

		if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))

		{
$errors[] = $lang->db_step_error_sqlite_invalid_dbname;
database_info();

		{
$errors[] = $lang->db_step_error_sqlite_invalid_dbname;
database_info();

Zeile 1723Zeile 1723
		$websiteurl = $hostname.'/';
$websitename = 'Your Website';
$contactemail = '';

		$websiteurl = $hostname.'/';
$websitename = 'Your Website';
$contactemail = '';

 

$protocol = "http://";
if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") || substr($bburl, 0, 5) == "https")
{
$protocol = "https://";
}


		// Attempt auto-detection
if($_SERVER['HTTP_HOST'])

		// Attempt auto-detection
if($_SERVER['HTTP_HOST'])

		{
$hostname = 'http://'.$_SERVER['HTTP_HOST'];

		{
$hostname = $protocol.$_SERVER['HTTP_HOST'];

			$cookiedomain = '.'.$_SERVER['HTTP_HOST'];
}
elseif($_SERVER['SERVER_NAME'])
{

			$cookiedomain = '.'.$_SERVER['HTTP_HOST'];
}
elseif($_SERVER['SERVER_NAME'])
{

			$hostname = 'http://'.$_SERVER['SERVER_NAME'];

			$hostname = $protocol.$_SERVER['SERVER_NAME'];

			$cookiedomain = '.'.$_SERVER['SERVER_NAME'];

			$cookiedomain = '.'.$_SERVER['SERVER_NAME'];

		}

		}

		
if(substr($cookiedomain, 0, 5) == ".www.")
{
$cookiedomain = my_substr($cookiedomain, 4);
}


		
if(substr($cookiedomain, 0, 5) == ".www.")
{
$cookiedomain = my_substr($cookiedomain, 4);
}


		if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['SERVER_NAME'] == 'localhost')

		if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['SERVER_NAME'] == 'localhost' || ip2long($_SERVER['SERVER_NAME']) != false)

		{
$cookiedomain = '';
}

		{
$cookiedomain = '';
}

Zeile 1768Zeile 1775
		$currentscript = $hostname.get_current_location();

if($currentscript)

		$currentscript = $hostname.get_current_location();

if($currentscript)

		{

		{

			$bburl = my_substr($currentscript, 0, my_strpos($currentscript, '/install/'));
}


			$bburl = my_substr($currentscript, 0, my_strpos($currentscript, '/install/'));
}


Zeile 1793Zeile 1800
		if(empty($mybb->input['bburl']))
{
$errors[] = $lang->config_step_error_url;

		if(empty($mybb->input['bburl']))
{
$errors[] = $lang->config_step_error_url;

		}

		}

		if(empty($mybb->input['bbname']))
{
$errors[] = $lang->config_step_error_name;

		if(empty($mybb->input['bbname']))
{
$errors[] = $lang->config_step_error_name;

Zeile 1915Zeile 1922
			{
$fields[] = $field['attributes']['name'];
}

			{
$fields[] = $field['attributes']['name'];
}

 


			$conditions = array();

			$conditions = array();

			

 
			if(is_array($view['conditions'][0]['condition']))

			if(is_array($view['conditions'][0]['condition']))

			{

			{

				foreach($view['conditions'][0]['condition'] as $condition)

				foreach($view['conditions'][0]['condition'] as $condition)

				{

				{

					if(!$condition['value']) continue;
if($condition['attributes']['is_serialized'] == 1)
{
$condition['value'] = unserialize($condition['value']);
}
$conditions[$condition['attributes']['name']] = $condition['value'];

					if(!$condition['value']) continue;
if($condition['attributes']['is_serialized'] == 1)
{
$condition['value'] = unserialize($condition['value']);
}
$conditions[$condition['attributes']['name']] = $condition['value'];

 
				}
}

$custom_profile_fields = array();
if(is_array($view['custom_profile_fields'][0]['field']))
{
foreach($view['custom_profile_fields'][0]['field'] as $field)
{
$custom_profile_fields[] = $field['attributes']['name'];

				}
}


				}
}


Zeile 1937Zeile 1953
				"title" => $db->escape_string($view['title'][0]['value']),
"fields" => $db->escape_string(serialize($fields)),
"conditions" => $db->escape_string(serialize($conditions)),

				"title" => $db->escape_string($view['title'][0]['value']),
"fields" => $db->escape_string(serialize($fields)),
"conditions" => $db->escape_string(serialize($conditions)),

 
				"custom_profile_fields" => $db->escape_string(serialize($custom_profile_fields)),

				"sortby" => $db->escape_string($view['sortby'][0]['value']),
"sortorder" => $db->escape_string($view['sortorder'][0]['value']),
"perpage" => intval($view['perpage'][0]['value']),

				"sortby" => $db->escape_string($view['sortby'][0]['value']),
"sortorder" => $db->escape_string($view['sortorder'][0]['value']),
"perpage" => intval($view['perpage'][0]['value']),

Zeile 2142Zeile 2159
	{
$db->create_fulltext_index('posts', 'message');
}

	{
$db->create_fulltext_index('posts', 'message');
}


// Register a shutdown function which actually tests if this functionality is working
add_shutdown('test_shutdown_function');

 

echo $lang->done_step_cachebuilding;
require_once MYBB_ROOT.'inc/class_datacache.php';


echo $lang->done_step_cachebuilding;
require_once MYBB_ROOT.'inc/class_datacache.php';

Zeile 2174Zeile 2188
	$cache->update_forumsdisplay();
$cache->update("plugins", array());
$cache->update("internal_settings", array('encryption_key' => random_str(32)));

	$cache->update_forumsdisplay();
$cache->update("plugins", array());
$cache->update("internal_settings", array('encryption_key' => random_str(32)));

	

	

	$version_history = array();
$dh = opendir(INSTALL_ROOT."resources");
while(($file = readdir($dh)) !== false)

	$version_history = array();
$dh = opendir(INSTALL_ROOT."resources");
while(($file = readdir($dh)) !== false)

Zeile 2188Zeile 2202
	$cache->update("version_history", $version_history);

echo $lang->done . '</p>';

	$cache->update("version_history", $version_history);

echo $lang->done . '</p>';





	echo $lang->done_step_success;

$written = 0;

	echo $lang->done_step_success;

$written = 0;

Zeile 2203Zeile 2217
		}
}
if(!$written)

		}
}
if(!$written)

	{

	{

		echo $lang->done_step_dirdelete;
}
echo $lang->done_subscribe_mailing;

		echo $lang->done_step_dirdelete;
}
echo $lang->done_subscribe_mailing;

Zeile 2226Zeile 2240
			break;
default:
$db = new DB_MySQL;

			break;
default:
$db = new DB_MySQL;

	}


	}


	// Connect to Database
define('TABLE_PREFIX', $config['database']['table_prefix']);

$db->connect($config['database']);
$db->set_table_prefix(TABLE_PREFIX);
$db->type = $config['database']['type'];

	// Connect to Database
define('TABLE_PREFIX', $config['database']['table_prefix']);

$db->connect($config['database']);
$db->set_table_prefix(TABLE_PREFIX);
$db->type = $config['database']['type'];

	

	

	return $db;
}


	return $db;
}


Zeile 2242Zeile 2256
{
$string = "<ul>\n";
foreach($array as $error)

{
$string = "<ul>\n";
foreach($array as $error)

	{

	{

		$string .= "<li>{$error}</li>\n";
}
$string .= "</ul>\n";

		$string .= "<li>{$error}</li>\n";
}
$string .= "</ul>\n";

Zeile 2250Zeile 2264
}

function write_settings()

}

function write_settings()

{

{

	global $db;

$query = $db->simple_select('settings', '*', '', array('order_by' => 'title'));

	global $db;

$query = $db->simple_select('settings', '*', '', array('order_by' => 'title'));

Zeile 2258Zeile 2272
	{
$setting['value'] = str_replace("\"", "\\\"", $setting['value']);
$settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n";

	{
$setting['value'] = str_replace("\"", "\\\"", $setting['value']);
$settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n";

	}

	}

	if(!empty($settings))
{
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n{$settings}\n?>";

	if(!empty($settings))
{
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n{$settings}\n?>";

Zeile 2266Zeile 2280
		fwrite($file, $settings);
fclose($file);
}

		fwrite($file, $settings);
fclose($file);
}

}

function test_shutdown_function()
{
global $db;

$db->update_query("settings", array('value' => 1), "name='useshutdownfunc'");
write_settings();

 
}
?>

}
?>