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

WordPress Trac noreply at wordpress.org
Mon Jan 23 11:43:29 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.2
Component:  Upload                  |     Version:  4.7.1
 Severity:  critical                |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+------------------------

Comment (by chrisl27):

 People that were specifically whitelisting unusual mime types/extensions
 via the upload_mimes files could restore the original functionality just
 for those whitelisted items using this wp_check_filetype_and_ext filter,
 if you don't want to edit core: (Note, not extensively tested)

 {{{
  function wp_check_filetype_and_ext($wp_check_filetype_and_ext, $file,
 $filename, $mimes) {
     // If the content was already okay
     if ($wp_check_filetype_and_ext['ext'] &&
 $wp_check_filetype_and_ext['type']) {
       return $wp_check_filetype_and_ext;
     }

     // If wp_check_filetype can establish the mime type from the
 upload_mimes filter, merge it into the result
     return array_merge($wp_check_filetype_and_ext,
 wp_check_filetype($filename, apply_filters('upload_mimes', array())));
   }
 }}}

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


More information about the wp-trac mailing list