From cc829f5f96282cbb67cb240ebd12e5cf359c1300 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 6 Jul 2008 16:40:15 +0000 Subject: [PATCH] Make sure attachment meta data is an array. Props nbachiyski. fixes #7252 git-svn-id: http://svn.automattic.com/wordpress/trunk@8261 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- wp-includes/post.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 61e31e808..7be0e50b0 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -274,7 +274,7 @@ function image_make_intermediate_size($file, $width, $height, $crop=false) { } 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; // get the best one for a specified set of dimensions diff --git a/wp-includes/post.php b/wp-includes/post.php index 0f17746e9..ba6e82178 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2424,7 +2424,7 @@ function wp_get_attachment_thumb_file( $post_id = 0 ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; - if ( !$imagedata = wp_get_attachment_metadata( $post->ID ) ) + if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) return false; $file = get_attached_file( $post->ID );