From 01943bacdcb541d5906a1de3f8e96c20f3290ee5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 27 May 2024 15:08:59 +0200 Subject: [PATCH] Fix #20165: Adjust pretty name of closures for PHP 8.4 compatibility --- CHANGELOG.md | 1 + web/ErrorHandler.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43c56c522..48630a5dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Yii Framework 2 Change Log - Enh #20134: Raise minimum `PHP` version to `7.3` (@terabytesoftw) - Bug #20141: Update `ezyang/htmlpurifier` dependency to version `4.17` (@terabytesoftw) - Bug #19817: Add MySQL Query `addCheck()` and `dropCheck()` (@bobonov) +- Bug #20165: Adjust pretty name of closures for PHP 8.4 compatibility (@staabm) 2.0.49.2 October 12, 2023 ------------------------- diff --git a/web/ErrorHandler.php b/web/ErrorHandler.php index 13b317c18..41843099e 100644 --- a/web/ErrorHandler.php +++ b/web/ErrorHandler.php @@ -204,7 +204,7 @@ public function addTypeLinks($code) $url = null; $shouldGenerateLink = true; - if ($method !== null && substr_compare($method, '{closure}', -9) !== 0) { + if ($method !== null && strpos($method, '{closure') === false) { $reflection = new \ReflectionClass($class); if ($reflection->hasMethod($method)) { $reflectionMethod = $reflection->getMethod($method);