[wp-trac] [WordPress Trac] #57898: Google Doc saved as .docx file not allowed in media library

WordPress Trac noreply at wordpress.org
Mon Mar 13 02:40:46 UTC 2023


#57898: Google Doc saved as .docx file not allowed in media library
--------------------------+------------------------------
 Reporter:  winterstreet  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Upload        |     Version:  6.1.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by mi5t4n):

 {{{#!php
 <?php
 File: wp-includes/functions.php
 3116:
 3117:   // Validate files that didn't get validated during previous
 checks.
 3118:   if ( $type && ! $real_mime && extension_loaded( 'fileinfo' ) ) {
 3119:           $finfo     = finfo_open( FILEINFO_MIME_TYPE );
 3120:           $real_mime = finfo_file( $finfo, $file );
 3121:           finfo_close( $finfo );
 3122:
 }}}



 The main issue is that `finfo_file()` is "returning application/vnd
 .openxmlformats-officedocument.wordprocessingml.documentapplication/vnd
 .openxmlformats-officedocument.wordprocessingml.document" mime_type for
 google docs. As we can see, it is just a redudant of mime type
 "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
 because of that the validation is failing.

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


More information about the wp-trac mailing list