Make WordPress Core

Changeset 37986


Ignore:
Timestamp:
07/06/2016 02:04:06 PM (9 years ago)
Author:
joemcgill
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r37952 r37986  
    10091009     */
    10101010    if ( ! isset( $image_sizes['thumbnail']['mime-type'] ) || 'image/gif' !== $image_sizes['thumbnail']['mime-type'] ) {
    1011         $image_sizes['full'] = array(
     1011        $image_sizes[] = array(
    10121012            'width'  => $image_meta['width'],
    10131013            'height' => $image_meta['height'],
Note: See TracChangeset for help on using the changeset viewer.