Make WordPress Core

Ticket #7252: imagedata-is_array.diff

File imagedata-is_array.diff, 970 bytes (added by nbachiyski, 18 years ago)
  • wp-includes/post.php

     
    24242424        $post_id = (int) $post_id;
    24252425        if ( !$post =& get_post( $post_id ) )
    24262426                return false;
    2427         if ( !$imagedata = wp_get_attachment_metadata( $post->ID ) )
     2427        if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )
    24282428                return false;
    24292429
    24302430        $file = get_attached_file( $post->ID );
  • wp-includes/media.php

     
    274274}
    275275
    276276function image_get_intermediate_size($post_id, $size='thumbnail') {
    277         if ( !$imagedata = wp_get_attachment_metadata( $post_id ) )
     277        if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) )
    278278                return false;
    279279
    280280        // get the best one for a specified set of dimensions