[wp-trac] [WordPress Trac] #53299: [PHP 8.1] Update `is_serialized` function to accept Enums

WordPress Trac noreply at wordpress.org
Sun May 30 08:23:18 UTC 2021


#53299: [PHP 8.1] Update `is_serialized` function to accept Enums
-------------------------+-----------------------------
 Reporter:  ayeshrajans  |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:  php81
  Focuses:               |
-------------------------+-----------------------------
 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
 [https://developer.wordpress.org/reference/functions/is_serialized/
 `is_serialized`] function. It tries to meticulously validate a serialized
 string. At the same time, Enums can be serialized, and uses its own
 [https://php.watch/versions/8.1/enums#serialize 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53299>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list