﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
20527,Adding sunrise-like capability to ms-files,isaacchapman,,"Currently sunrise.php is not included on multi-site file downloads as it is only called from /wp-includes/ms-settings.php, which is not included by /wp-includes/ms-files.php. Since mu-plugins and plugins are also skipped by SHORTINIT, there is no way to customize file downloading of which I am aware.

Because the existing sunrise.php include capability isn't exactly aligned with this issue, a separate file to be included makes sense to me. The attached diff will include a WP_CONTENT_DIR . '/sunrise_ms_files.php' file if SUNRISE_MS_FILES is defined in wp-config.php. 

While my concern is securing file downloads for members-only sites (by including custom user-to-file authorization code), this fix could also allow for easily setting custom mime types. Example sunrise_ms_files.php content:

{{{
<?php
add_filter('upload_mimes', 'add_custom_mime_types');
function add_custom_mime_types($mimes = array()) {
	$mimes['abc'] = 'application/abracadabra';
	$mimes['def'] = 'application/defense';
	return $mimes;	
}
?>
}}}

#20136 and #14659 are related to the MIME type issue.",feature request,closed,normal,,Multisite,,normal,wontfix,,
