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 | 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
Note: See
TracTickets for help on using
tickets.
Hello @paulsowden, welcome to WordPress Trac!
Thanks for your report. @joemcgill Could you weigh in here? Is this expected behaviour?