Skip to content

Commit

Permalink
Correctly handle 0x0 sizes returned from getimagesize, using shim f…
Browse files Browse the repository at this point in the history
…allback for AVIFs
  • Loading branch information
adamsilverstein committed Jan 12, 2024
1 parent 8555bfb commit e25becb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -5512,7 +5512,11 @@ function wp_getimagesize( $filename, array &$image_info = null ) {
}
}

if ( false !== $info ) {
if (
false !== $info &&
// Some PHP versions return 0x0 sizes from `getimagesize` for unrecognized image formats, including AVIFs
! ( empty( $info[0] ) && empty( $info[1] ) )
) {
return $info;
}

Expand Down

0 comments on commit e25becb

Please sign in to comment.