[wp-trac] [WordPress Trac] #11946: Ensure image MIME type matches extension
WordPress Trac
wp-trac at lists.automattic.com
Sat May 15 02:07:05 UTC 2010
#11946: Ensure image MIME type matches extension
-------------------------------------+--------------------------------------
Reporter: Viper007Bond | Owner: Viper007Bond
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 3.0
Component: Upload | Version: 3.0
Severity: minor | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+--------------------------------------
Changes (by Viper007Bond):
* keywords: needs-patch => has-patch needs-testing
* status: assigned => accepted
Comment:
`11946.4.patch` introduces `wp_check_filetype_and_ext()` which does what
`wp_check_filetype()` does, but then goes on to attempt to validate the
type and extension. If it determines that the extension doesn't match what
the type truly is, then it'll return `proper_filename` as a part of it's
returned array.
I've modified the standard upload function, the sideload function, and the
bits function to make use of this new function.
I have only tested this using the standard upload process, not sideload or
bits.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11946#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list