[wp-trac] [WordPress Trac] #21299: upload_mimes filter doesn't work occasionally
WordPress Trac
wp-trac at lists.automattic.com
Tue Jul 17 19:07:38 UTC 2012
#21299: upload_mimes filter doesn't work occasionally
--------------------------+-----------------------------
Reporter: dpacmittal | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.4.1
Severity: normal | Keywords:
--------------------------+-----------------------------
get_allowed_mime_types() in wp-includes/functions.php contains static
variable $mimes. So if get_allowed_mime_types() is called before a filter
is added, apply_filters() for 'upload_mimes' is not called, rendering the
filter useless.
It happened on one of my websites where get_allowed_mime_types() was being
called even before 'upload_mimes' filters were added from the theme's
functions.php.
Best fix is to remove the static variable. Thoughts?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21299>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list