From ceb905f70c77af0be5254db7ea960bdeb485cefc Mon Sep 17 00:00:00 2001 From: Moaead Yahya Date: Wed, 21 Jan 2026 07:50:58 +0000 Subject: [PATCH] Fix deprecated DateTimeInterface::RFC7231 constant for PHP 8.5 Replace the deprecated DateTimeInterface::RFC7231 constant with its equivalent format string 'D, d M Y H:i:s \G\M\T' to avoid deprecation warnings on PHP 8.5. Fixes #20037 Signed-off-by: moaead <165377585+moaead@users.noreply.github.com> Signed-off-by: Moaead Yahya --- src/Core.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Core.php b/src/Core.php index aed8bc8c09..599d2b3aac 100644 --- a/src/Core.php +++ b/src/Core.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace PhpMyAdmin; -use DateTimeInterface; use DateTimeZone; use PhpMyAdmin\Clock\Clock; use PhpMyAdmin\Error\ErrorHandler; @@ -232,7 +231,7 @@ class Core public static function getNoCacheHeaders(ClockInterface $clock): array { $headers = []; - $formattedDateTime = $clock->now()->setTimezone(new DateTimeZone('UTC'))->format(DateTimeInterface::RFC7231); + $formattedDateTime = $clock->now()->setTimezone(new DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'); // rfc2616 - Section 14.21 $headers['Expires'] = $formattedDateTime;