Skip to content

Commit 194792a

Browse files
committed
fix(UserConfig): cast getTypedValue() result to string in getValueBool()
PHP 8.4 made passing non-strings to strtolower() a fatal TypeError. getTypedValue() can return a non-string under certain conditions, causing strtolower() at the call site to throw. The (string) cast guards against this regardless of what getTypedValue() returns. Fixes #59629
1 parent abd693e commit 194792a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Config/UserConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ public function getValueBool(
686686
bool $default = false,
687687
bool $lazy = false,
688688
): bool {
689-
$b = strtolower($this->getTypedValue($userId, $app, $key, $default ? 'true' : 'false', $lazy, ValueType::BOOL));
689+
$b = strtolower((string)$this->getTypedValue($userId, $app, $key, $default ? 'true' : 'false', $lazy, ValueType::BOOL));
690690
return in_array($b, ['1', 'true', 'yes', 'on']);
691691
}
692692

0 commit comments

Comments
 (0)