WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#53299 new enhancement

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

Reported by: ayeshrajans Owned by:
Milestone: 5.9 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 (1)

#1 @SergeyBiryukov
4 months ago

  • Milestone changed from Awaiting Review to 5.9
Note: See TracTickets for help on using tickets.