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
This commit is contained in:
Andrew Ozz 2020-07-10 23:04:08 +00:00
parent 4337c258dc
commit 5d85a53292
1 changed files with 1 additions and 3 deletions

View File

@ -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'] );