diff --git a/system/Cache/Handlers/PredisHandler.php b/system/Cache/Handlers/PredisHandler.php index 0dab42a25635..a597989c39ce 100644 --- a/system/Cache/Handlers/PredisHandler.php +++ b/system/Cache/Handlers/PredisHandler.php @@ -88,7 +88,11 @@ public function get(string $key) return match ($data['__ci_type']) { 'array', 'object' => unserialize($data['__ci_value']), - 'boolean', 'integer', 'double', 'string', 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, + 'boolean', + 'integer', + 'double', // Yes, 'double' is returned and NOT 'float' + 'string', + 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, default => null, }; } diff --git a/system/Cache/Handlers/RedisHandler.php b/system/Cache/Handlers/RedisHandler.php index 24b40bf98da0..0050e1d6fe6c 100644 --- a/system/Cache/Handlers/RedisHandler.php +++ b/system/Cache/Handlers/RedisHandler.php @@ -114,7 +114,11 @@ public function get(string $key) return match ($data['__ci_type']) { 'array', 'object' => unserialize($data['__ci_value']), - 'boolean', 'integer', 'double', 'string', 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, + 'boolean', + 'integer', + 'double', // Yes, 'double' is returned and NOT 'float' + 'string', + 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, default => null, }; } diff --git a/system/Common.php b/system/Common.php index e7644c080a13..e5577ea017b9 100644 --- a/system/Common.php +++ b/system/Common.php @@ -373,6 +373,7 @@ function env(string $key, $default = null) return $default; } + // Handle any boolean values return match (strtolower($value)) { 'true' => true, 'false' => false,