Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#40609 new defect (bug)

Cannot register an application/foo+xml mime type without also registering application/xml

Reported by: paulsowden's profile paulsowden Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Upload Keywords:
Focuses: Cc:

Description

In wp_check_filetype_and_ext() there is a block that uses finfo_file to sniff the mime type of a file. When registering an application/foo+xml type the returned type from finfo_file is application/xml so to allow application/foo+xml using the upload_mimes filter one must also allow application/xml otherwise this real_mime check fails.

It seems like the check should allow the original mime type if the real_mime is application/xml and the $mime is of the form application/foo+xml

Change History (1)

#1 @ocean90
7 years ago

  • Version trunk deleted

Hello @paulsowden, welcome to WordPress Trac!

Thanks for your report. @joemcgill Could you weigh in here? Is this expected behaviour?

Note: See TracTickets for help on using tickets.