Skip to content

Commit

Permalink
Mime Types: support uploading wav files in Firefox
Browse files Browse the repository at this point in the history
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.




git-svn-id: https://develop.svn.wordpress.org/trunk@59389 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
ramonjd committed Nov 12, 2024
1 parent e647b07 commit 6f47a2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 6f47a2c

Please sign in to comment.