Make sure attachment meta data is an array. Props nbachiyski. fixes #7252

git-svn-id: https://develop.svn.wordpress.org/trunk@8261 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-07-06 16:40:15 +00:00
parent 7dccf2c37c
commit ecf41b5b88
2 changed files with 2 additions and 2 deletions

View File

@ -274,7 +274,7 @@ function image_make_intermediate_size($file, $width, $height, $crop=false) {
} }
function image_get_intermediate_size($post_id, $size='thumbnail') { function image_get_intermediate_size($post_id, $size='thumbnail') {
if ( !$imagedata = wp_get_attachment_metadata( $post_id ) ) if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) )
return false; return false;
// get the best one for a specified set of dimensions // get the best one for a specified set of dimensions

View File

@ -2424,7 +2424,7 @@ function wp_get_attachment_thumb_file( $post_id = 0 ) {
$post_id = (int) $post_id; $post_id = (int) $post_id;
if ( !$post =& get_post( $post_id ) ) if ( !$post =& get_post( $post_id ) )
return false; return false;
if ( !$imagedata = wp_get_attachment_metadata( $post->ID ) ) if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )
return false; return false;
$file = get_attached_file( $post->ID ); $file = get_attached_file( $post->ID );