fix settings read/write

This commit is contained in:
Jean-Christian Paul Denis 2023-04-27 21:52:35 +02:00
parent c809e2c6e0
commit 5ceeb79318
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 3 additions and 3 deletions

View File

@ -55,8 +55,8 @@ class Config extends dcNsProcess
# -- Set settings -- # -- Set settings --
try { try {
foreach ($s->listSettings() as $key) { foreach ($s->listSettings() as $key => $value) {
$s->writeSetting($key, $_POST[$key] ?? ''); $s->writeSetting($key, $_POST[$key] ?? $value);
} }
dcPage::addSuccessNotice( dcPage::addSuccessNotice(

View File

@ -91,6 +91,6 @@ class Settings
*/ */
public function listSettings(): array public function listSettings(): array
{ {
return array_keys(get_class_vars(Settings::class)); return get_object_vars($this);
} }
} }