[wp-trac] [WordPress Trac] #40017: wp_get_image_mime() returns 'application/octet-stream' for non-image files.
WordPress Trac
noreply at wordpress.org
Fri Mar 17 13:16:00 UTC 2017
#40017: wp_get_image_mime() returns 'application/octet-stream' for non-image files.
----------------------------------------+--------------------
Reporter: blobfolio | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7.4
Component: Media | Version: 4.7.1
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+--------------------
Changes (by joemcgill):
* keywords: has-patch dev-feedback needs-unit-tests => has-patch needs-
unit-tests
Comment:
Good catch @blobfolio. After chatting on Slack about this, it sounds like
we don't need the strict checking on 'false' there and could simplify to
`( ! $imagetype )`. Whenever strict checking of bool values makes no
difference, I tend to prefer the simpler style.
I also agree with @swissspidy about adding a simple PHPUnit test for this,
if practical.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40017#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list