Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#21410 closed enhancement (invalid)

Misleading function description for check_upload_mimes

Reported by: Cimmo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: Multisite Keywords:
Focuses: Cc:


The description for check_upload_mimes is misleading. Specifically "This function is used to filter that list against..." for that list seems talks about what returned by get_allowed_mime_types() but this is not true, since there is no call to get_allowed_mime_types() in the code.

Instead filter $mimes input array against the filetype whitelist provided by Multisite. Please fix the description.

 * Check an array of MIME types against a whitelist.
 * WordPress ships with a set of allowed upload filetypes,
 * which is defined in wp-includes/functions.php in
 * get_allowed_mime_types(). This function is used to filter
 * that list against the filetype whitelist provided by Multisite
 * Super Admins at wp-admin/network/settings.php.
 * @since MU
 * @param array $mimes
 * @return array
function check_upload_mimes( $mimes ) {

Change History (3)

#1 @SergeyBiryukov
6 years ago

Related: #20997

The description appears to be correct.

check_upload_mimes() is hooked to upload_mimes filter, which is used in get_allowed_mime_types():

#2 @Cimmo
6 years ago

Oh ok, wasn't clear enough since I couldn't find documentation on codex, probably because nobody really needs to call it from their plug-in.

#3 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.