Skip to content

Commit d26bf95

Browse files
committed
feat(core): cast valid booleans when setting system configs
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent 78cfe37 commit d26bf95

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/Command/Config/System/SetConfig.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6161
$configValue = $this->castHelper->castValue($input->getOption('value'), $input->getOption('type'));
6262
$updateOnly = $input->getOption('update-only');
6363

64+
// If value is string false or true, cast them too
65+
if (is_string($configValue['value'])) {
66+
$lowerValue = strtolower($configValue['value']);
67+
if ($lowerValue === 'false' || $lowerValue === 'true') {
68+
$configValue = $this->castHelper->castValue($input->getOption('value'), 'boolean');
69+
}
70+
}
71+
6472
if (count($configNames) > 1) {
6573
$existingValue = $this->systemConfig->getValue($configName);
6674

0 commit comments

Comments
 (0)