Make WordPress Core

Ticket #48324: 48324.1.diff

File 48324.1.diff, 682 bytes (added by Hareesh Pillai, 5 years ago)

Patch updated as per the latest comment

  • src/wp-includes/media.php

     
    220220        // If the file isn't an image, attempt to replace its URL with a rendered image from its meta.
    221221        // Otherwise, a non-image type could be returned.
    222222        if ( ! $is_image ) {
    223                 if ( ! empty( $meta['sizes'] ) ) {
     223                if ( ! empty( $meta['sizes']['full'] ) ) {
    224224                        $img_url          = str_replace( $img_url_basename, $meta['sizes']['full']['file'], $img_url );
    225225                        $img_url_basename = $meta['sizes']['full']['file'];
    226226                        $width            = $meta['sizes']['full']['width'];