Make WordPress Core

Opened 2 months ago

Last modified 29 hours ago

#62483 reviewing enhancement

maybe_serialize() does support double serialization, but does not the developer if doing so

Reported by: apermo's profile apermo Owned by: audrasjb's profile audrasjb
Milestone: 6.8 Priority: normal
Severity: normal Version: 3.6.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

In #12930 the support of double serialization was added, in order not to break instances where developers used maybe_serialize() wrong, I recently stumbled upon a case from 2023 where this also happened.

I suggest adding a _doing_it_wrong() if serialized code was sent to maybe_serialize in order to make less experienced developers aware of this.

Patch coming

Change History (4)

This ticket was mentioned in PR #7847 on WordPress/wordpress-develop by @apermo.


2 months ago
#1

  • Keywords has-patch added

Added _doing_it_wrong() to maybe_serialize to notify about double serialization.

Trac ticket: [](https://core.trac.wordpress.org/ticket/62483#ticket)

#2 @audrasjb
2 days ago

  • Milestone changed from Awaiting Review to 6.8
  • Owner set to audrasjb
  • Status changed from new to reviewing

Thanks for the PR, looks good to me at a glance.
I restarted the github actions to ensure phpunit tests are passing.
Moving to 6.8.

@audrasjb commented on PR #7847:


2 days ago
#3

@apermo PHP Unit Tests are failing, this changeset will require some test case update.

@apermo commented on PR #7847:


29 hours ago
#4

@audrasjb I'll try to figure out how to fix them. In case I need help I'll reach out.

Note: See TracTickets for help on using tickets.