From 5d85a532921f5b90db1370b95c8fab4598c70afa Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 10 Jul 2020 23:04:08 +0000 Subject: [PATCH] Media: Tiny logic fix in `wp_image_file_matches_image_meta()` after [48329]. No need to look in `sizes` if the full size image path/URL matches. See #50543. git-svn-id: https://develop.svn.wordpress.org/trunk@48430 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 4361ee753d..d316f1a6f3 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1522,9 +1522,7 @@ function wp_image_file_matches_image_meta( $image_location, $image_meta ) { // Check if the relative image path from the image meta is at the end of $image_location. if ( strrpos( $image_location, $image_meta['file'] ) === strlen( $image_location ) - strlen( $image_meta['file'] ) ) { $match = true; - } - - if ( ! empty( $image_meta['sizes'] ) ) { + } elseif ( ! empty( $image_meta['sizes'] ) ) { // Retrieve the uploads sub-directory from the full size image. $dirname = _wp_get_attachment_relative_path( $image_meta['file'] );