From 5987caeecc440f5aa2777cb48c2eac8eaf37e6be Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 15 Jun 2019 01:32:53 +0000 Subject: [PATCH] After [45538]: fix a WPCS fix and make couple of var names consistent. See #40439. Built from https://develop.svn.wordpress.org/trunk@45539 git-svn-id: http://core.svn.wordpress.org/trunk@45350 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 6 +++--- wp-includes/media.php | 6 +++++- wp-includes/version.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) 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.