[wp-trac] [WordPress Trac] #11946: Ensure image MIME type matches extension

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 20 22:45:41 UTC 2010


#11946: Ensure image MIME type matches extension
--------------------------+-------------------------------------------------
 Reporter:  Viper007Bond  |       Owner:                  
     Type:  defect (bug)  |      Status:  new             
 Priority:  lowest        |   Milestone:  2.9.2           
Component:  Upload        |     Version:  3.0             
 Severity:  minor         |    Keywords:  has-patch tested
--------------------------+-------------------------------------------------

Comment(by Viper007Bond):

 Replying to [comment:8 hakre]:
 > Don't we have an array already in there that is offering mime-types per
 extension? I think it's adviseable to use the same datasource here therein
 the patch as well instead offering duplicate data.

 That array (in `get_allowed_mime_types()`) is a list of allowed MIMEs
 that's filterable. It also has multiple extensions to one common MIME.
 Yes, I guess I could array_flip() it and then pop off the first extension,
 however I didn't think this was reliable enough due to the filter.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11946#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list