Merge pull request #42833 from nextcloud/enh/noid/set-boolean-config

small improvement on occ app:config:set
This commit is contained in:
Ferdinand Thiessen 2024-02-09 14:02:28 +01:00 committed by GitHub
commit be049ba6b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -207,9 +207,9 @@ class SetConfig extends Base {
break;
case IAppConfig::VALUE_BOOL:
if (strtolower($value) === 'true') {
if (in_array(strtolower($value), ['true', '1', 'on', 'yes'])) {
$valueBool = true;
} elseif (strtolower($value) === 'false') {
} elseif (in_array(strtolower($value), ['false', '0', 'off', 'no'])) {
$valueBool = false;
} else {
throw new AppConfigIncorrectTypeException('Value is not a boolean, please use \'true\' or \'false\'');