[wp-trac] [WordPress Trac] #39550: Some Non-image files fail to upload after 4.7.1

WordPress Trac noreply at wordpress.org
Mon Mar 13 00:05:43 UTC 2017


#39550: Some Non-image files fail to upload after 4.7.1
---------------------------+------------------------
 Reporter:  greatislander  |       Owner:  joemcgill
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:  4.7.3
Component:  Upload         |     Version:  4.7.1
 Severity:  critical       |  Resolution:  fixed
 Keywords:  fixed-major    |     Focuses:
---------------------------+------------------------

Comment (by blobfolio):

 Replying to [comment:157 imelgrat]:
 > Replying to [comment:137 blobfolio]:
 >
 > Hello blobfolio:
 >
 > I just wanted to thank you for the snippet. Changing the MIME type for
 OGV files to video/ogg instead of application/ogg did the trick. I can now
 upload OGV files both in Linux and Windows setups. Anyone having trouble
 with OGV file uploads should try this.

 Hehe. Yeah, the trick is ensuring that whatever "wrong" value PHP returns
 (if it begins with `application/...`) is somewhere in the whitelist,
 anywhere in the whitelist.

 In a pinch, you can tell WordPress to expect the same wrong media type
 your particular environment is returning, but in cases like the OGG
 example where, by coincidence, the generic parent class for OGV and OGA
 also happens to be the ''specific'' class for the less common OGX, you can
 also just add the correct OGX definition to the whitelist (leaving OGA and
 OGV correctly defined, which are whitelisted by default).

 It's just a workaround, not ideal. I'm hoping to see some movement on
 #39963 in the near future, which will help WordPress better deal with all
 the possible variability they're seeing from server to server (without
 compromising the security issues 4.7.1 was meant to fix).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39550#comment:158>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list