[wp-trac] [WordPress Trac] #22949: More Accurate and Extensible MIME Type Handling

WordPress Trac noreply at wordpress.org
Fri Dec 14 22:08:17 UTC 2012


#22949: More Accurate and Extensible MIME Type Handling
-----------------------------+-------------------------
 Reporter:  mattonomics      |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Media
  Version:  trunk            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+-------------------------
 In the general case, a file extension may represent more than one MIME
 type. Currently, file extensions are married to a single MIME.

 Specifically, let's look at the case of the "ico" file extension.
 Officially, the MIME type for this file should be
 "image/vnd.microsoft.icon". Unofficially, "image/x-icon" along with many
 others are usable.

 The solution to this problem is extremely simple.

 First, allow key => value pairs in the exhaustive MIME list located in
 wp_get_mime_types to be arrays so we can account for cases such as ico.

 Second, add the proper handling for this change in wp_check_filetype. The
 way I have written it should not interfere with existing uses of this
 function (as they were all passing strings and now can pass a string or
 array).

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


More information about the wp-trac mailing list