Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Controller/SettingsController.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php
index 24a7f1ad..ef3e2a04 100644
--- a/lib/Controller/SettingsController.php
+++ b/lib/Controller/SettingsController.php
@@ -232,12 +232,15 @@ class SettingsController extends Controller{
'data' => ['message' => $this->l10n->t('Invalid config key') . ' ' . $fullKey]
], Http::STATUS_BAD_REQUEST);
}
- $value = $value === true ? 'yes' : $value;
- $value = $value === false ? 'no' : $value;
- if (AppConfig::APP_SETTING_TYPES[$fullKey] === 'array') {
- $value = implode(',', $value);
+ $parsedValue = $value;
+ if (is_bool($value)) {
+ $parsedValue = $value ? 'yes' : 'no';
}
- $this->appConfig->setAppValue($fullKey, $value);
+ $appSettingsType = isset(AppConfig::APP_SETTING_TYPES[$fullKey]) ? AppConfig::APP_SETTING_TYPES[$fullKey] : 'string';
+ if ($appSettingsType === 'array') {
+ $parsedValue = implode(',', $value);
+ }
+ $this->appConfig->setAppValue($fullKey, $parsedValue);
}
$response = [