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

WordPress Trac noreply at wordpress.org
Fri Feb 24 13:57:46 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 needs-testing  |     Focuses:
-------------------------------------+------------------------

Comment (by kontur):

 Thanks a lot! I will refactor this into my plugin to work around the issue
 until a fix is in place.

 I couldn't find "wp_check_filetype_and_ext" in this reference:
 https://codex.wordpress.org/Plugin_API/Filter_Reference but it seems to
 work anyhow.

 Replying to [comment:110 blobfolio]:
 > Replying to [comment:108 kontur]:
 > > Yes, I understand. At any rate, this bug pretty much renders a plugin
 of mine useless, since it is centred around uploading and displaying
 webfonts, all of which, I think, require that the accepted mime type gets
 augmented, and then successfully passes this check - which currently it
 doesn't, or seemingly only sporadic on some installations.
 >
 > You could add a filter to your plugin to specifically bypass the issue
 only for font files, either re-implementing a looser `finfo` check (but
 again for font files I don't expect that will work consistently), or just
 rebuilding the ext/type data by passing the original filename back through
 `wp_check_filetype`. Take a look at this function for inspiration:
 https://github.com/Blobfolio/blob-common/blob/master/wp/functions-
 behavior.php#L31  Obviously all the class stuff is a bit out of scope for
 your needs, but if you remove 75% of it you should have what you need.

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


More information about the wp-trac mailing list