WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#7623 closed defect (bug) (fixed)

get_post_meta fails to unserialize when $single=false

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

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 (1)

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

Download all attachments as: .zip

Change History (4)

andy6 years ago

comment:1 westi6 years ago

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

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

comment:2 westi6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen for 2.6.2

comment:3 westi6 years ago

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

(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.