[wp-trac] [WordPress Trac] #30788: Media library views: inconsistent behaviour with mime type groups

WordPress Trac noreply at wordpress.org
Tue Dec 30 17:30:31 UTC 2014


#30788: Media library views: inconsistent behaviour with mime type groups
--------------------------+------------------------------
 Reporter:  mdgl          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:  2nd-opinion   |     Focuses:  javascript
--------------------------+------------------------------
Changes (by mdgl):

 * keywords:   => 2nd-opinion


Comment:

 Patch uploaded which allows `wp_match_mime_types()` to deal with an array
 of comma-separated MIME types (effectively a double nesting issue). This
 appears to fix this problem but the code here is quite convoluted and I
 would like a second opinion on this solution. It is also unclear to me why
 the original code added a third regular expression to match the main MIME
 type pattern un-anchored, so I have removed this.

 Also, because the screen filter selection value may now include a comma, I
 had to revert to the original solution presented in #30123, namely using
 `esc_attr()` rather than `sanitize_mime_type()` when preparing links for
 the filter dropdown. This seems more correct in any case.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30788#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list