Ticket #7252 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

Attachment medata can evaluate as truth, but still be corrupted

Reported by: nbachiyski Assigned to: anonymous
Priority: normal Milestone: 2.6
Component: General Version:
Severity: normal Keywords: has-patch
Cc:

Description

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

imagedata-is_array.diff (0.9 kB) - added by nbachiyski on 07/06/08 08:23:52.

Change History

07/06/08 08:23:52 changed by nbachiyski

  • attachment imagedata-is_array.diff added.

07/06/08 16:40:16 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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