From 84bd75ea882863beabd36135b083089027040540 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 15 Jan 2018 22:24:41 +0000 Subject: [PATCH] Media: Add `flac` to the list of allowed file types. Props blobfolio. Merges [42451] to the 4.9 branch. Fixes #42225. Built from https://develop.svn.wordpress.org/branches/4.9@42452 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42282 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 3 ++- wp-includes/media.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index bfc93eed77..56fc4040e0 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2449,6 +2449,7 @@ function wp_get_mime_types() { 'ra|ram' => 'audio/x-realaudio', 'wav' => 'audio/wav', 'ogg|oga' => 'audio/ogg', + 'flac' => 'audio/flac', 'mid|midi' => 'audio/midi', 'wma' => 'audio/x-ms-wma', 'wax' => 'audio/x-ms-wax', @@ -2534,7 +2535,7 @@ function wp_get_ext_types() { */ return apply_filters( 'ext2type', array( 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ), - 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), + 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'flac', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), 'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ), 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ), 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ), diff --git a/wp-includes/media.php b/wp-includes/media.php index 1981f3ad9a..dc49414629 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2157,9 +2157,9 @@ function wp_get_audio_extensions() { * @since 3.6.0 * * @param array $extensions An array of support audio formats. Defaults are - * 'mp3', 'ogg', 'm4a', 'wav'. + * 'mp3', 'ogg', 'flac', 'm4a', 'wav'. */ - return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'm4a', 'wav' ) ); + return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) ); } /**