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

WordPress Trac noreply at wordpress.org
Tue Apr 11 00:32:26 UTC 2023


#57898: Google Doc saved as .docx file not allowed in media library
---------------------------------------------------+-----------------------
 Reporter:  winterstreet                           |       Owner:  audrasjb
     Type:  defect (bug)                           |      Status:  accepted
 Priority:  normal                                 |   Milestone:  6.3
Component:  Upload                                 |     Version:  6.1.1
 Severity:  normal                                 |  Resolution:
 Keywords:  has-patch has-screenshots 2nd-opinion  |     Focuses:
---------------------------------------------------+-----------------------
Changes (by azaozz):

 * keywords:  has-patch has-screenshots => has-patch has-screenshots 2nd-
     opinion


Comment:

 Replying to [comment:5 mi5t4n]:

 > 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.

 Sounds like a bug in `finfo_file()`?

 Frankly I'm not sure about the patch in https://github.com/WordPress
 /wordpress-develop/pull/4228 as this is somewhat security related. If this
 is a bug in finfo_file() that seems to happen only for `*.docx` files
 saved by Google Docs, lets add an exception for this particular case only.
 I.e. match the whole wrong mime type string and replace it with the right
 one.

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


More information about the wp-trac mailing list