[wp-trac] [WordPress Trac] #40175: Upload Validation / MIME Handling

WordPress Trac noreply at wordpress.org
Tue Feb 11 22:24:09 UTC 2020


#40175: Upload Validation / MIME Handling
-------------------------------------------------+-------------------------
 Reporter:  blobfolio                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  high                                 |   Milestone:  Future
                                                 |  Release
Component:  Media                                |     Version:  4.7.3
 Severity:  major                                |  Resolution:
 Keywords:  has-unit-tests early needs-dev-note  |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------

Comment (by PerS):

 Just had an issue with uploading a password powerpoint presentation. I had
 the mime type set to `application/vnd.openxmlformats-
 officedocument.presentationml.presentation`. Uploading been working, but
 now I got the error "Unexpected response from the server. The file may
 have been uploaded successfully ...".
 After debugging we found that the problem is in
 `wp_check_filetype_and_ext` and that a password protected powerpoint file
 is identified as `application/vnd.ms-powerpoint`

 You can test this by doing:
 {{{
 $finfo     = finfo_open( FILEINFO_MIME_TYPE );
 echo finfo_file( $finfo, 'passwordprotected.pptx' );
 //output: application/vnd.ms-powerpoint
 echo finfo_file( $finfo, 'not-passwordprotected.pptx' );
 //output: application/vnd.openxmlformats-
 officedocument.presentationml.presentation
 }}}

 So, when will "MIME alias" awareness be added ?

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


More information about the wp-trac mailing list