Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#7252 closed defect (bug) (fixed)

Attachment medata can evaluate as truth, but still be corrupted

Reported by: nbachiyski Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:


At two places in the code there are checks like:

if ( !$imagedata = wp_get_attachment_metadata( $post_id ) )

which if satisfied expect $imagedata to be an array. But if there is non-unserializable value in the postmeta table it will be returned as a string, which will break the code after the check.

Here is patch, which uses is_array() instead.

Attachments (1)

imagedata-is_array.diff (970 bytes) - added by nbachiyski 10 years ago.

Download all attachments as: .zip

Change History (2)

#1 @ryan
10 years ago

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

(In [8261]) Make sure attachment meta data is an array. Props nbachiyski. fixes #7252

Note: See TracTickets for help on using tickets.