Make WordPress Core


Ignore:
Timestamp:
11/12/2024 12:51:17 AM (6 months ago)
Author:
ramonopoly
Message:

Mime Types: support uploading wav files in Firefox

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r59358 r59389  
    34183418 * @since 4.9.2 Support was added for Flac (.flac) files.
    34193419 * @since 4.9.6 Support was added for AAC (.aac) files.
     3420 * @since 6.8.0 Support was added for `audio/x-wav`.
    34203421 *
    34213422 * @return string[] Array of mime types keyed by the file extension regex corresponding to those types.
     
    34823483            'aac'                          => 'audio/aac',
    34833484            'ra|ram'                       => 'audio/x-realaudio',
    3484             'wav'                          => 'audio/wav',
     3485            'wav|x-wav'                    => 'audio/wav',
    34853486            'ogg|oga'                      => 'audio/ogg',
    34863487            'flac'                         => 'audio/flac',
Note: See TracChangeset for help on using the changeset viewer.