From ebe553f9c09f30526b199f226a2e146f29773ce7 Mon Sep 17 00:00:00 2001 From: Yoann MOROCUTTI Date: Thu, 4 Sep 2025 18:13:01 +0200 Subject: [PATCH] fix: Fix an issue when sending an HTTP code not defined in the RFC (like 420) is throwing an error [symfony6-4] --- Twig/Extension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Twig/Extension.php b/Twig/Extension.php index bfa32cc..8fea4ec 100644 --- a/Twig/Extension.php +++ b/Twig/Extension.php @@ -240,7 +240,7 @@ protected function fetchInfosFromCodeOrResponse(int|array $codeOrResponse): arra $level = 'default'; } - $statusText = $code === 'N/A' ? 'N/A' : Response::$statusTexts[$code]; + $statusText = $code === 'N/A' ? 'N/A' : Response::$statusTexts[$code] ?? 'N/A'; return [ 'fromCache' => $fromCache,