WordPress.org

Make WordPress Core

Changeset 50144


Ignore:
Timestamp:
02/02/2021 03:26:13 PM (4 months ago)
Author:
joemcgill
Message:

Media: Make filename checks less strict in 'wp_image_src_get_dimensions'.

This modifies the check for full size files so that only the basename is compared with the image src to avoid misses whenever the src path has been modified.

Props ianmjones.
Fixes: #52417.

File:
1 edited

Legend:

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

    r50136 r50144  
    16051605    if (
    16061606        isset( $image_meta['file'] ) &&
    1607         strpos( $image_src, $image_meta['file'] ) !== false
     1607        strpos( $image_src, wp_basename( $image_meta['file'] ) ) !== false
    16081608    ) {
    16091609        $dimensions = array(
Note: See TracChangeset for help on using the changeset viewer.