diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 24cfbb7b33..18ce7c2fec 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3265,12 +3265,8 @@ function wp_get_image_mime( $file ) { return $mime; } - $handle = fopen( $file, 'rb' ); - if ( false === $handle ) { - return false; - } + $magic = file_get_contents( $file, false, null, 0, 12 ); - $magic = fread( $handle, 12 ); if ( false === $magic ) { return false; } @@ -3289,8 +3285,6 @@ function wp_get_image_mime( $file ) { ) { $mime = 'image/webp'; } - - fclose( $handle ); } catch ( Exception $e ) { $mime = false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index edcadd7361..10a057c5a0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52700'; +$wp_version = '6.0-alpha-52701'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.