diff --git a/system/libs/Settings.php b/system/libs/Settings.php
index 86b2b41b..bfa85237 100644
--- a/system/libs/Settings.php
+++ b/system/libs/Settings.php
@@ -129,6 +129,9 @@ class Settings implements ArrayAccess
if (is_bool($value)) {
$settingsDb[$key] = $value ? 'true' : 'false';
}
+ elseif (is_array($value)) {
+ $settingsDb[$key] = $value;
+ }
else {
$settingsDb[$key] = (string)$value;
}
@@ -530,8 +533,11 @@ class Settings implements ArrayAccess
public static function saveConfig($config, $filename, &$content = '')
{
- $content = " $value) {
$content .= "\$config['$key'] = ";
diff --git a/system/settings.php b/system/settings.php
index d95e16d7..26245ea3 100644
--- a/system/settings.php
+++ b/system/settings.php
@@ -1588,7 +1588,13 @@ Sent by MyAAC,
'beforeSave' => function(&$settings, &$values) {
global $config;
- $configToSave = [];
+ $configOriginal = $config;
+ unset($config);
+
+ $config = [];
+ require BASE . 'config.local.php';
+
+ $configToSave = $config;
$server_path = '';
$database = [];
@@ -1625,7 +1631,7 @@ Sent by MyAAC,
// if fail - revert the setting and inform the user
if (!file_exists($server_path . 'config.lua')) {
error('Server Path is invalid - cannot find config.lua in the directory. Setting have been reverted.');
- $configToSave['server_path'] = $config['server_path'];
+ $configToSave['server_path'] = $configOriginal['server_path'];
}
// test database connection
@@ -1633,7 +1639,7 @@ Sent by MyAAC,
if ($database['database_overwrite'] && !Settings::testDatabaseConnection($database)) {
foreach ($database as $key => $value) {
if (!in_array($key, ['database_log', 'database_persistent'])) { // ignore these two
- $configToSave[$key] = $config[$key];
+ $configToSave[$key] = $configOriginal[$key];
}
}
}