[wp-trac] [WordPress Trac] #7252: Attachment medata can evaluate as truth, but still be corrupted

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 6 08:23:46 GMT 2008


#7252: Attachment medata can evaluate as truth, but still be corrupted
------------------------+---------------------------------------------------
 Reporter:  nbachiyski  |       Owner:  anonymous
     Type:  defect      |      Status:  new      
 Priority:  normal      |   Milestone:  2.6      
Component:  General     |     Version:           
 Severity:  normal      |    Keywords:  has-patch
------------------------+---------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7252>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list