From 3712752f76a53f0c8e375828f334c6e26b8201e2 Mon Sep 17 00:00:00 2001 From: ramonopoly Date: Tue, 12 Nov 2024 00:53:18 +0000 Subject: [PATCH] Mime Types: support uploading wav files in Firefox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When uploading `wav` files in the editor, Chrome and other browsers identify the mime type of the file as `audio/wav`. Firefox, however, identifies the mime type as `audio/x-wav`. This commit updates the `'wav'` mime type key in `wp_get_mime_types()` to support `x-wav` so that uploading wav files work in Firefox. Previously, the editor reported an unsupported mime type error. Props imranh920, ramonopoly. Fixes #61948. Built from https://develop.svn.wordpress.org/trunk@59389 git-svn-id: http://core.svn.wordpress.org/trunk@58775 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index ef2ce9d9c3..d9303083bf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3417,6 +3417,7 @@ function wp_get_image_mime( $file ) { * @since 4.2.0 Support was added for GIMP (.xcf) files. * @since 4.9.2 Support was added for Flac (.flac) files. * @since 4.9.6 Support was added for AAC (.aac) files. + * @since 6.8.0 Support was added for `audio/x-wav`. * * @return string[] Array of mime types keyed by the file extension regex corresponding to those types. */ @@ -3481,7 +3482,7 @@ function wp_get_mime_types() { 'mp3|m4a|m4b' => 'audio/mpeg', 'aac' => 'audio/aac', 'ra|ram' => 'audio/x-realaudio', - 'wav' => 'audio/wav', + 'wav|x-wav' => 'audio/wav', 'ogg|oga' => 'audio/ogg', 'flac' => 'audio/flac', 'mid|midi' => 'audio/midi', diff --git a/wp-includes/version.php b/wp-includes/version.php index 5027ef3975..f5887d3616 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59388'; +$wp_version = '6.8-alpha-59389'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.