diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 539194642d..24cfbb7b33 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -6566,16 +6566,10 @@ function wp_scheduled_delete() { * @return string[] Array of file header values keyed by header name. */ function get_file_data( $file, $default_headers, $context = '' ) { - // We don't need to write to the file, so just open for reading. - $fp = fopen( $file, 'r' ); + // Pull only the first 8 KB of the file in. + $file_data = file_get_contents( $file, false, null, 0, 8 * KB_IN_BYTES ); - if ( $fp ) { - // Pull only the first 8 KB of the file in. - $file_data = fread( $fp, 8 * KB_IN_BYTES ); - - // PHP will close file handle, but we are good citizens. - fclose( $fp ); - } else { + if ( false === $file_data ) { $file_data = ''; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9ea4ae884f..54a3df76ed 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52697'; +$wp_version = '6.0-alpha-52698'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.