[wp-trac] [WordPress Trac] #30123: Custom Mime Type filter problem in upload.php list view

WordPress Trac noreply at wordpress.org
Sat Jan 3 11:58:00 UTC 2015


#30123: Custom Mime Type filter problem in upload.php list view
--------------------------+-----------------------------
 Reporter:  csschris      |       Owner:  wonderboymusic
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.1
Component:  Media         |     Version:  4.0
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:  administration
--------------------------+-----------------------------

Comment (by mdgl):

 Hello birgire, yes, changing `sanitize_mime_type()` as you suggest would
 fix the problem, but I don't think this is the right way to go. The comma
 is not valid in (simple) MIME type names [see
 [https://www.ietf.org/rfc/rfc2045.txt] and [http://www.rfc-
 editor.org/rfc/rfc2231.txt]] and by changing this function we might be
 introducing problems elsewhere.

 The bug here is simply that the value needs escaping as it is being used
 inside a HTML attribute, so I think your original suggestion of using
 `esc_attr()` is the correct solution.

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


More information about the wp-trac mailing list