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
This commit is contained in:
Joe McGill 2021-02-02 15:28:04 +00:00
parent 06c4b334fa
commit 373ee89c83
2 changed files with 2 additions and 2 deletions

View File

@ -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'],

View File

@ -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.