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 <moaead@gmail.com>
This commit is contained in:
parent
3b961d3c84
commit
ceb905f70c
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user