diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 0ce97b5f76..5b667f4ab5 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -87,7 +87,7 @@ function wp_get_missing_image_subsizes( $attachment_id ) { // Meta error? if ( empty( $image_meta ) ) { - return $defined_sizes; + return $registered_sizes; } $full_width = (int) $image_meta['width']; @@ -379,8 +379,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { */ $fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata ); - $defined_sizes = wp_get_registered_image_subsizes(); - $merged_sizes = array_intersect_key( $defined_sizes, array_flip( $fallback_sizes ) ); + $registered_sizes = wp_get_registered_image_subsizes(); + $merged_sizes = array_intersect_key( $registered_sizes, array_flip( $fallback_sizes ) ); // Force thumbnails to be soft crops. if ( isset( $merged_sizes['thumbnail'] ) && is_array( $merged_sizes['thumbnail'] ) ) { diff --git a/wp-includes/media.php b/wp-includes/media.php index 20cc1b4261..e1180c28f0 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -235,7 +235,11 @@ function image_downsize( $id, $size = 'medium' ) { } elseif ( $size === 'thumbnail' ) { // fall back to the old thumbnail $thumb_file = wp_get_attachment_thumb_file( $id ); - $info = getimagesize( $thumb_file ); + $info = null; + + if ( $thumb_file ) { + $info = getimagesize( $thumb_file ); + } if ( $thumb_file && $info ) { $img_url = str_replace( $img_url_basename, wp_basename( $thumb_file ), $img_url ); diff --git a/wp-includes/version.php b/wp-includes/version.php index efaa7c79d4..7a7d9a2e4a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45538'; +$wp_version = '5.3-alpha-45539'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.