From 9462c458ffb54d9aefd910b451e49d938a8ad0af Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 20 Sep 2020 13:13:46 +0000 Subject: [PATCH] Media: Correct the image thumbnail logic in media templates. This ensures the correct data properties are checked before displaying image thumbnails. Props chetan200891 Fixes #49655 git-svn-id: https://develop.svn.wordpress.org/trunk@49012 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media-template.php | 4 ++-- src/wp-includes/media.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php index 0a07b5619f..1f69382f12 100644 --- a/src/wp-includes/media-template.php +++ b/src/wp-includes/media-template.php @@ -536,7 +536,7 @@ function wp_print_media_templates() {
<# if ( data.uploading ) { #>
- <# } else if ( 'image' === data.type && data.sizes ) { #> + <# } else if ( 'image' === data.type && data.size && data.size.url ) { #>
@@ -598,7 +598,7 @@ function wp_print_media_templates() {
<# if ( data.uploading ) { #>
- <# } else if ( 'image' === data.type && data.sizes ) { #> + <# } else if ( 'image' === data.type && data.size && data.size.url ) { #> <# } else { #> diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index e1091b9d8e..9dfc8b0b69 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -2406,8 +2406,8 @@ function gallery_shortcode( $attr ) { function wp_underscore_playlist_templates() { ?>