Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3566,6 +3566,11 @@
<code><![CDATA[$CONFIG]]></code>
</UndefinedVariable>
</file>
<file src="lib/private/Config/UserConfig.php">
<RedundantCast>
<code><![CDATA[(string)$this->getTypedValue($userId, $app, $key, $default ? 'true' : 'false', $lazy, ValueType::BOOL)]]></code>
</RedundantCast>
</file>
<file src="lib/private/Console/Application.php">
<NoInterfaceProperties>
<code><![CDATA[$this->request->server]]></code>
Expand Down
6 changes: 5 additions & 1 deletion lib/private/Config/UserConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,11 @@ public function getValueBool(
bool $default = false,
bool $lazy = false,
): bool {
$b = strtolower($this->getTypedValue($userId, $app, $key, $default ? 'true' : 'false', $lazy, ValueType::BOOL));
// The explicit (string) cast guards against a PHP OPcache bug where values passed
// by reference across function boundaries can have their type corrupted (e.g. bool
// returned as int). Affects PHP 8.x with OPcache enabled; fixed upstream in
// https://github.com/php/php-src/pull/21973. Keep until minimum PHP version is bumped.
$b = strtolower((string)$this->getTypedValue($userId, $app, $key, $default ? 'true' : 'false', $lazy, ValueType::BOOL));
Comment thread
nickvergessen marked this conversation as resolved.
return in_array($b, ['1', 'true', 'yes', 'on']);
}

Expand Down
Loading