[wp-trac] [WordPress Trac] #39552: SVG upload support broken in 4.7.1

WordPress Trac noreply at wordpress.org
Thu Jan 12 21:27:17 UTC 2017


#39552: SVG upload support broken in 4.7.1
----------------------------------------+--------------------
 Reporter:  freakpants                  |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.7.2
Component:  Upload                      |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:
----------------------------------------+--------------------

Comment (by ralva83702):

 Are you saying this patch is going to require php 7? In my case $mime is
 getting set to "application/octet-stream"  right before the change on line
 2393 so just checking that it's false isn't doing anything but returning
 false for svg files and still showing the security error.

 Replying to [comment:9 freakpants]:
 > While not documented, application/octet-stream is the expected result
 when image_type_to_mime_type is called with something that isn't one of
 the constants:
 >
 > {{{#!php
 > default:
 > case IMAGE_FILETYPE_UNKNOWN:
 >     return "application/octet-stream"; /* suppose binary format */
 > }}}
 >
 > (as seen in https://github.com/php/php-
 src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/ext/standard/image.c)
 >
 > In our specific case it is called with "false", since exif-imagetype
 cant detect svg.

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


More information about the wp-trac mailing list