diff --git a/app/Views/errors/cli/error_exception.php b/app/Views/errors/cli/error_exception.php index 983cb8885140..b49244f5a054 100644 --- a/app/Views/errors/cli/error_exception.php +++ b/app/Views/errors/cli/error_exception.php @@ -33,7 +33,7 @@ foreach ($backtraces as $i => $error) { $padFile = ' '; // 4 spaces $padClass = ' '; // 7 spaces - $c = str_pad($i + 1, 3, ' ', STR_PAD_LEFT); + $c = str_pad((string) ($i + 1), 3, ' ', STR_PAD_LEFT); if (isset($error['file'])) { $filepath = clean_path($error['file']) . ':' . $error['line']; diff --git a/system/Cache/Handlers/FileHandler.php b/system/Cache/Handlers/FileHandler.php index 4d16bbffac2f..ab0e51c289a4 100644 --- a/system/Cache/Handlers/FileHandler.php +++ b/system/Cache/Handlers/FileHandler.php @@ -204,7 +204,7 @@ protected function getItem(string $filename): array|false } try { - $data = unserialize($content, ['allowed_classes' => false]); + $data = unserialize($content, ['allowed_classes' => true]); } catch (Throwable) { return false; } diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 1c638d58e88e..b2cbbf802f29 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -1,7 +1,5 @@ 'The command will use this as foo.', diff --git a/tests/_support/Controllers/Newautorouting.php b/tests/_support/Controllers/Newautorouting.php index 30d89c2db30e..2c31547ed2de 100644 --- a/tests/_support/Controllers/Newautorouting.php +++ b/tests/_support/Controllers/Newautorouting.php @@ -1,7 +1,5 @@ config = new Cache(); $this->handler = CacheFactory::getHandler($this->config, 'predis'); + $this->handler->clean(); } protected function tearDown(): void diff --git a/tests/system/Debug/ExceptionsTest.php b/tests/system/Debug/ExceptionsTest.php index 69e062671b7a..2e06add612f7 100644 --- a/tests/system/Debug/ExceptionsTest.php +++ b/tests/system/Debug/ExceptionsTest.php @@ -67,8 +67,8 @@ public function testDeprecationsOnPhp81DoNotThrow(): void $this->exception->initialize(); try { - $result = str_contains('foobar', null); // @phpstan-ignore argument.type (Needed for testing) - $this->assertLogContains('error', '[DEPRECATED] str_contains(): '); + @trigger_error('Hello! I am a deprecation!', E_USER_DEPRECATED); + $this->assertLogContains('error', '[DEPRECATED] Hello! I am a deprecation!'); } catch (ErrorException) { $this->fail('The catch block should not be reached.'); } finally {