[wp-trac] [WordPress Trac] #22128: Adding upload mimetype in Multisite does not work if mimetype is not already defined

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 8 13:13:55 UTC 2012


#22128: Adding upload mimetype in Multisite does not work if mimetype is not
already defined
-----------------------------+--------------------------
 Reporter:  BjornW           |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Multisite
  Version:  trunk            |   Severity:  critical
 Keywords:  dev-feedback     |
-----------------------------+--------------------------
 '''Description'''

 We would like to add 3gp to the list of file types to be uploaded in the
 sites of our network install.

 We've tried to add 3gp to the Network Settings->Upload File Types setting
 for this. However after having saved the setting we were still not able to
 upload 3gp. It seems the user setting is being overruled by the list of
 global settings.

 '''Steps to reproduce issue:'''
 1. Use WordPress Network install (aka Multisite)
 2. Add the file extension 3gp to the upload file types setting in Network
 Settings
 3. Save Settings
 4. Try to upload a 3gp file using the Media Library, it will fail with the
 message: 'Sorry, this file type is not permitted for security reasons.'

 It seems the upload file types defined in the Network Settings cannot
 overrule / add new file types if this file type has not already been
 defined in the function wp_get_mime_types() (see file: wp-
 includes/functions.php).

 '''Expected behaviour'''

 Changing the Upload File Types by adding a new extension results in
 WordPress accepting files ending in this extension. Or warn the admin that
 this extension is unknown and more info (such as the full mime type) is
 needed.

 '''Proposed solution'''

 We are aware of the hook 'upload_mimes' to fix this with a plugin, but we
 suggest that the superadmin Network Settings->upload file type overrules
 WordPress' built-in defaults instead of the other way around.

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


More information about the wp-trac mailing list