[wp-trac] [WordPress Trac] #20527: Adding sunrise-like capability to ms-files

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 23 19:59:06 UTC 2012


#20527: Adding sunrise-like capability to ms-files
-----------------------------+-----------------------------
 Reporter:  isaacchapman     |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Multisite        |    Version:
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20527>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list