From cdf5d84b738b60817dc833451aed53f781eaf97d Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 22 Sep 2011 08:29:35 +0000 Subject: [PATCH] Add support for rar and 7x file uploading. Fixes #16412 props Caspie. git-svn-id: https://develop.svn.wordpress.org/trunk@18751 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f762203f71..a0b0bbf8bf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2432,7 +2432,7 @@ function wp_ext2type( $ext ) { 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsb', 'xlsm' ), 'interactive' => array( 'key', 'ppt', 'pptx', 'pptm', 'odp', 'swf' ), 'text' => array( 'asc', 'csv', 'tsv', 'txt' ), - 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip' ), + 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ), 'code' => array( 'css', 'htm', 'html', 'php', 'js' ), )); foreach ( $ext2type as $type => $exts ) @@ -2598,6 +2598,8 @@ function get_allowed_mime_types() { 'tar' => 'application/x-tar', 'zip' => 'application/zip', 'gz|gzip' => 'application/x-gzip', + 'rar' => 'application/rar', + '7z' => 'application/x-7z-compressed', 'exe' => 'application/x-msdownload', // openoffice formats 'odt' => 'application/vnd.oasis.opendocument.text',