From 373ee89c839d49302018a108d57775b6b0606f42 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Tue, 2 Feb 2021 15:28:04 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@50144 git-svn-id: http://core.svn.wordpress.org/trunk@49823 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 088e6868c7..ea8ca0b68c 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1604,7 +1604,7 @@ function wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id = // Is it a full size image? if ( isset( $image_meta['file'] ) && - strpos( $image_src, $image_meta['file'] ) !== false + strpos( $image_src, wp_basename( $image_meta['file'] ) ) !== false ) { $dimensions = array( (int) $image_meta['width'], diff --git a/wp-includes/version.php b/wp-includes/version.php index 2ae3eec8b3..582669cd3a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-50143'; +$wp_version = '5.7-alpha-50144'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.