[wp-trac] [WordPress Trac] #39550: Some Non-image files fail to upload after 4.7.1
WordPress Trac
noreply at wordpress.org
Tue Feb 14 22:51:12 UTC 2017
#39550: Some Non-image files fail to upload after 4.7.1
------------------------------------+------------------------
Reporter: greatislander | Owner: joemcgill
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.7.3
Component: Upload | Version: 4.7.1
Severity: critical | Resolution:
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+------------------------
Comment (by joemcgill):
Replying to [comment:98 blobfolio]:
Thanks for the quick response. I don't believe `$mime_to_exts` was ever
being used to affect whether an image was allowed to be uploaded, but
instead was used to rename image files to use the correct extension if it
were determined to be different than what is returned by
`wp_check_filetype()` but found in `$mime_to_exts`. Previously, if WP
couldn't rename the file, it would pass back whatever
`wp_check_filetype()` reported.
This means that now any mime types you want to add via the `upload_mimes`
filter would need to pass our checks in `wp_check_filetype_and_ext()` or
you will also need to filter the output of `wp_check_filetype_and_ext()`
as well. A bit annoying, but perhaps an acceptable tradeoff? What we don't
want to do is make `$mime_to_exts` a blanket whitelist of mime-to-
extension possibilities.
Thanks for the catch on the `FILEINFO_MIME_TYPE` introduction. I'll make
that update.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39550#comment:100>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list