Ticket #7623 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 3 years ago

get_post_meta fails to unserialize when $single=false

Reported by: andy Owned by: ryan
Priority: normal Milestone: 2.6.2
Component: General Version: 2.6.1
Severity: normal Keywords: has-patch
Cc: andy

Description

When $single=false the return should be an array. maybe_unserialize is being applied to the array of rows so it doesn't do anything. It should be applied to each member of that array. Patch uses array_map and removes redundant logic.

If any plugin code is compensating by running maybe_unserialize on the array members, it will not be affected. If it uses unserialize, which is inadvisable anyway, it will break.

Attachments

7623.diff Download (978 bytes) - added by andy 3 years ago.

Change History

andy3 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [8824]) maybe_unserialize the array members not the array when multple post meta items are returned. Fixes #7623 for trunk props andy.

  • Status changed from closed to reopened
  • Resolution fixed deleted

Reopen for 2.6.2

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [8825]) maybe_unserialize the array members not the array when multple post meta items are returned. Fixes #7623 for 2.6 branch props andy.

Note: See TracTickets for help on using tickets.