diff --git a/wp-includes/post.php b/wp-includes/post.php index 1a91a183ad..b0967dbad8 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -6870,6 +6870,11 @@ function wp_mime_type_icon( $mime = 0, $preferred_ext = '.png' ) { $icon = wp_cache_get( "mime_type_icon_$mime" ); } + // Check if preferred file format variable is present and is a validly formatted file extension. + if ( ! empty( $preferred_ext ) && is_string( $preferred_ext ) && ! str_starts_with( $preferred_ext, '.' ) ) { + $preferred_ext = '.' . strtolower( $preferred_ext ); + } + $post_id = 0; if ( empty( $icon ) ) { $post_mimes = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 44e2622217..4a07b0f97c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58247'; +$wp_version = '6.6-alpha-58248'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.