diff --git a/src/Config.php b/src/Config.php index 5860fcd..76002e0 100644 --- a/src/Config.php +++ b/src/Config.php @@ -55,8 +55,8 @@ class Config extends dcNsProcess # -- Set settings -- try { - foreach ($s->listSettings() as $key) { - $s->writeSetting($key, $_POST[$key] ?? ''); + foreach ($s->listSettings() as $key => $value) { + $s->writeSetting($key, $_POST[$key] ?? $value); } dcPage::addSuccessNotice( diff --git a/src/Settings.php b/src/Settings.php index 1354717..db230d6 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -91,6 +91,6 @@ class Settings */ public function listSettings(): array { - return array_keys(get_class_vars(Settings::class)); + return get_object_vars($this); } }