mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Upload: Correct duplicate MIME type for .xlsx files generated by Google Docs.
This expands the code block previously added for `.docx` files to include `.xlsx` files as well, which are known to have the same issue with `finfo_file()`. Includes a unit test case for `wp_check_filetype_and_ext()`. Reference: [https://bugs.php.net/bug.php?id=77784 PHP Bug #77784: mime_content_type() result gets doubled for .xlsx]. Follow-up to [56497]. See #57898. git-svn-id: https://develop.svn.wordpress.org/trunk@56510 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Binary file not shown.
@@ -1643,6 +1643,16 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
'proper_filename' => false,
|
||||
),
|
||||
),
|
||||
// Google Docs file for which finfo_file() returns a duplicate mime type.
|
||||
array(
|
||||
DIR_TESTDATA . '/uploads/double-mime-type.docx',
|
||||
'double-mime-type.docx',
|
||||
array(
|
||||
'ext' => 'docx',
|
||||
'type' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'proper_filename' => false,
|
||||
),
|
||||
),
|
||||
// Non-image file with wrong sub-type.
|
||||
array(
|
||||
DIR_TESTDATA . '/uploads/pages-to-word.docx',
|
||||
|
||||
Reference in New Issue
Block a user