WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 3 weeks ago

#53299 new enhancement

[PHP 8.1] Update `is_serialized` function to accept Enums

Reported by: ayeshrajans Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: General Keywords: php81
Focuses: Cc:

Description

PHP 8.1 finally brings Enums! It is not backwards compatible with older PHP versions, so it will be a long time before we can make a meaningful use of it with WordPress.

While reading #53295 , I had a concern with the WordPress's `is_serialized` function. It tries to meticulously validate a serialized string. At the same time, Enums can be serialized, and uses its own Serialized text representation for Enums. I think we should update the function to account for the new E identifier.

Ticket #53295 suggests to not make a precise validation in the first place if it deems safer, but this ticket is more about updating the existing rules to accommodate the new symbol.

Thank you.

Change History (2)

#1 @SergeyBiryukov
6 months ago

  • Milestone changed from Awaiting Review to 5.9

#2 @hellofromTonya
3 weeks ago

  • Milestone changed from 5.9 to Future Release

With 5.9 feature freeze being tomorrow and no progress on this ticket, ran out of time to introduce Enums. Moving to Future Release as the next milestone is not yet available. But once it is, let's explore this feature in the next cycle (which starts in a little over a week).

Note: See TracTickets for help on using tickets.