Skip to content

refactor: do not use future-deprecated DATE_RFC7231 constant #9657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2025

Conversation

paulbalandan
Copy link
Member

Description
It will be deprecated in PHP 8.5: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added the refactor Pull requests that refactor code label Aug 2, 2025
@michalsn
Copy link
Member

michalsn commented Aug 2, 2025

While the constant is deprecated, I don't believe we should ditch the GMT format here, as the expire value for the cookie header should use this date format.

@paulbalandan
Copy link
Member Author

Yes, that is true. But we are just relying this time on the T TZ format instead of the hardcoded GMT timezone (which was the reason why the constant was deprecated). Also, in Cookie::getExpiresString() we already use the gmdate() call ensuring the resulting date string is always in GMT.

Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With gmdate() that makes sense. Thanks!

@paulbalandan paulbalandan merged commit ebc25b4 into codeigniter4:4.7 Aug 3, 2025
50 checks passed
@paulbalandan paulbalandan deleted the refactor-cookie-date branch August 3, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants