From ecfff6fe8076f2919c12ea17536a8575392ad65f Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 20 Sep 2020 13:15:04 +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 Built from https://develop.svn.wordpress.org/trunk@49012 git-svn-id: http://core.svn.wordpress.org/trunk@48774 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media-template.php | 4 ++-- wp-includes/media.php | 4 ++-- wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 0a07b5619f..1f69382f12 100644 --- a/wp-includes/media-template.php +++ b/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/wp-includes/media.php b/wp-includes/media.php index e1091b9d8e..9dfc8b0b69 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2406,8 +2406,8 @@ function gallery_shortcode( $attr ) { function wp_underscore_playlist_templates() { ?>