"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/install/upgrade.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

upgrade.php  (mybb_1821):upgrade.php  (mybb_1822)
skipping to change at line 986 skipping to change at line 986
require MYBB_ROOT."inc/settings.php"; require MYBB_ROOT."inc/settings.php";
foreach($settings as $key => $val) foreach($settings as $key => $val)
{ {
$db->update_query("settings", array('value' => $db->escap e_string($val)), "name='".$db->escape_string($key)."'"); $db->update_query("settings", array('value' => $db->escap e_string($val)), "name='".$db->escape_string($key)."'");
} }
} }
unset($settings); unset($settings);
$query = $db->simple_select("settings", "*", "", array('order_by' => 'tit le')); $query = $db->simple_select("settings", "*", "", array('order_by' => 'tit le'));
while($setting = $db->fetch_array($query)) while($setting = $db->fetch_array($query))
{ {
$setting['value'] = str_replace("\"", "\\\"", $setting['value']); $setting['name'] = addcslashes($setting['name'], "\\'");
$setting['value'] = addcslashes($setting['value'], '\\"$');
$settings .= "\$settings['{$setting['name']}'] = \"".$setting['va lue']."\";\n"; $settings .= "\$settings['{$setting['name']}'] = \"".$setting['va lue']."\";\n";
} }
$settings = "<?php\n/*********************************\ \n DO NOT EDIT T HIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/ \n\n$settings\n"; $settings = "<?php\n/*********************************\ \n DO NOT EDIT T HIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/ \n\n$settings\n";
$file = fopen(MYBB_ROOT."inc/settings.php", "w"); $file = fopen(MYBB_ROOT."inc/settings.php", "w");
fwrite($file, $settings); fwrite($file, $settings);
fclose($file); fclose($file);
return array($groupcount, $settingcount); return array($groupcount, $settingcount);
} }
/** /**
skipping to change at line 1132 skipping to change at line 1133
/** /**
* Write our settings to the settings file * Write our settings to the settings file
*/ */
function write_settings() function write_settings()
{ {
global $db; global $db;
$query = $db->simple_select("settings", "*", "", array('order_by' => 'tit le')); $query = $db->simple_select("settings", "*", "", array('order_by' => 'tit le'));
while($setting = $db->fetch_array($query)) while($setting = $db->fetch_array($query))
{ {
$setting['value'] = $db->escape_string($setting['value']); $setting['name'] = addcslashes($setting['name'], "\\'");
$setting['value'] = addcslashes($setting['value'], '\\"$');
$settings .= "\$settings['{$setting['name']}'] = \"{$setting['val ue']}\";\n"; $settings .= "\$settings['{$setting['name']}'] = \"{$setting['val ue']}\";\n";
} }
if(!empty($settings)) if(!empty($settings))
{ {
$settings = "<?php\n/*********************************\ \n DO NO T EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\************************** *******/\n\n{$settings}\n"; $settings = "<?php\n/*********************************\ \n DO NO T EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\************************** *******/\n\n{$settings}\n";
$file = fopen(MYBB_ROOT."inc/settings.php", "w"); $file = fopen(MYBB_ROOT."inc/settings.php", "w");
fwrite($file, $settings); fwrite($file, $settings);
fclose($file); fclose($file);
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)