Skip to content

Commit cb13aa3

Browse files
committed
Fix "Cannot use bool as array" error in PHP 8.5
1 parent cd301d0 commit cb13aa3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/wp-admin/includes/image.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,13 @@ function wp_read_image_metadata( $file ) {
827827
return false;
828828
}
829829

830-
list( , , $image_type ) = wp_getimagesize( $file );
830+
$image_size = wp_getimagesize( $file );
831+
832+
if ( false === $image_size ) {
833+
return false;
834+
}
835+
836+
list( , , $image_type ) = $image_size;
831837

832838
/*
833839
* EXIF contains a bunch of data we'll probably never need formatted in ways

0 commit comments

Comments
 (0)