WordPress.org

Make WordPress Core

Changeset 46773 for branches/5.3


Ignore:
Timestamp:
11/25/2019 10:07:32 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Media: Avoid a PHP notice in image_downsize() when trying to replace a non-image URL with a rendered image from its meta.

Props Mte90, jrf, hareesh-pillai.
Merges [46772] to the 5.3 branch.
Fixes #48324.

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • branches/5.3/src/wp-includes/media.php

    r46418 r46773  
    215215    // Otherwise, a non-image type could be returned.
    216216    if ( ! $is_image ) {
    217         if ( ! empty( $meta['sizes'] ) ) {
     217        if ( ! empty( $meta['sizes']['full'] ) ) {
    218218            $img_url          = str_replace( $img_url_basename, $meta['sizes']['full']['file'], $img_url );
    219219            $img_url_basename = $meta['sizes']['full']['file'];
Note: See TracChangeset for help on using the changeset viewer.