From bf41fcb7ecaa2b74de865401e6ce3ee5be8635dd Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Thu, 13 Jun 2024 10:00:11 +0000 Subject: [PATCH] =?UTF-8?q?Networks=20and=20sites:=20use=20get=5Fallowed?= =?UTF-8?q?=5Fmime=5Ftypes=20to=20populate=20multisite=E2=80=99s=20upload?= =?UTF-8?q?=5Ffiletypes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure new multisite installs are up to date with the current mime types supported in core. Note that this will only affect newly created networks, since this is only used to populate the schema for new networks, not change the allowed mime types for existing networks Props spacedmonkey, costdev, pavanpatil1, joemcgill, rajinsharwar, tb1909. Fixes #53167. Built from https://develop.svn.wordpress.org/trunk@58400 git-svn-id: http://core.svn.wordpress.org/trunk@57849 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 40 +++++++----------------------------- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index cd06364caf..33e90a9b6e 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -1243,39 +1243,13 @@ We hope you enjoy your new site. Thanks! --The Team @ SITE_NAME' ); - $misc_exts = array( - // Images. - 'jpg', - 'jpeg', - 'png', - 'gif', - 'webp', - 'avif', - // Video. - 'mov', - 'avi', - 'mpg', - '3gp', - '3g2', - // "audio". - 'midi', - 'mid', - // Miscellaneous. - 'pdf', - 'doc', - 'ppt', - 'odt', - 'pptx', - 'docx', - 'pps', - 'ppsx', - 'xls', - 'xlsx', - 'key', - ); - $audio_exts = wp_get_audio_extensions(); - $video_exts = wp_get_video_extensions(); - $upload_filetypes = array_unique( array_merge( $misc_exts, $audio_exts, $video_exts ) ); + $allowed_file_types = array(); + $all_mime_types = get_allowed_mime_types(); + + foreach ( $all_mime_types as $ext => $mime ) { + array_push( $allowed_file_types, ...explode( '|', $ext ) ); + } + $upload_filetypes = array_unique( $allowed_file_types ); $sitemeta = array( 'site_name' => __( 'My Network' ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 694b8a3a9f..c26dfd6d42 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-beta2-58399'; +$wp_version = '6.6-beta2-58400'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.