Make WordPress Core

Changeset 50136


Ignore:
Timestamp:
02/02/2021 04:25:18 AM (4 years ago)
Author:
joemcgill
Message:

Media: Sanity check image meta in 'wp_image_src_get_dimensions'.

This fixes a potential illegal offset error introduced in [50134] if the $image_meta doesn't include a file key.

Props dd32.
Fixes #51865.

File:
1 edited

Legend:

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

    r50134 r50136  
    16031603
    16041604    // Is it a full size image?
    1605     if ( strpos( $image_src, $image_meta['file'] ) !== false ) {
     1605    if (
     1606        isset( $image_meta['file'] ) &&
     1607        strpos( $image_src, $image_meta['file'] ) !== false
     1608    ) {
    16061609        $dimensions = array(
    16071610            (int) $image_meta['width'],
Note: See TracChangeset for help on using the changeset viewer.