From 73cd1b3f8fc64b17e0ed6025c0eebb2a98dda2dc Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Wed, 6 Jul 2016 14:04:06 +0000 Subject: [PATCH] Media: Don't use 'full' as array key in `wp_calculate_image_srcset()`. In `wp_calculate_image_srcset()` we get an array of image sizes associated with an attachment and then add the original image's information to the array before processing the `srcset`. In doing so, we set the original data to a `$image_sizes['full']` key, which could stomp on any custom image sizes using `full` as a size name. This avoid the issues by adding the original data without a named key, which is never referenced anyway. Props jaspermdegroot. Fixes #36345. git-svn-id: https://develop.svn.wordpress.org/trunk@37986 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index e9e5a291f0..6a060b1c30 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1008,7 +1008,7 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac * If src is an intermediate size GIF, the full size is excluded from srcset to keep a flattened GIF from becoming animated. */ if ( ! isset( $image_sizes['thumbnail']['mime-type'] ) || 'image/gif' !== $image_sizes['thumbnail']['mime-type'] ) { - $image_sizes['full'] = array( + $image_sizes[] = array( 'width' => $image_meta['width'], 'height' => $image_meta['height'], 'file' => $image_basename,