[wp-trac] [WordPress Trac] #39550: Some Non-image files fail to upload after 4.7.1
WordPress Trac
noreply at wordpress.org
Fri Feb 17 21:56:13 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:101 blobfolio]:
> If an upload doesn't match the `$mime_to_ext` list, it is outside the
purview of that particular challenge and should be passed down the chain
to `finfo` and eventually `upload_mimes`.
I tend to agree that we should revalidate anything that misses the
`wp_get_image_mimes()` check, rather than blocking them at that point.
I've thought about combining all validation for all mimes into a single
place, rather than different paths for images vs other files, but my early
testing showed that doing so would increase memory/time for image uploads.
Still, might be worth attempting, but in the mean time using the
`finfo_file()` check as a fallback for any file that isn't validated at
that point is probably the best option.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39550#comment:104>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list