mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Changed: set_config() won't actually update the database if config values match
git-svn-id: file:///svn/phpbb/trunk@4053 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d2f1d9e8bc
commit
bea13814e7
1 changed files with 7 additions and 5 deletions
|
@ -24,12 +24,15 @@ function set_config($config_name, $config_value, $is_dynamic = FALSE)
|
||||||
global $db, $cache, $config;
|
global $db, $cache, $config;
|
||||||
|
|
||||||
if (isset($config[$config_name]))
|
if (isset($config[$config_name]))
|
||||||
|
{
|
||||||
|
if ($config[$config_name] != $config_value)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . CONFIG_TABLE . "
|
$sql = 'UPDATE ' . CONFIG_TABLE . "
|
||||||
SET config_value = '" . $db->sql_escape($config_value) . "'
|
SET config_value = '" . $db->sql_escape($config_value) . "'
|
||||||
WHERE config_name = '$config_name'";
|
WHERE config_name = '$config_name'";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "
|
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "
|
||||||
|
@ -1339,7 +1342,6 @@ function page_footer()
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->display('body');
|
$template->display('body');
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue