php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78720 finfo_file reports double mimetype
Submitted: 2019-10-22 14:17 UTC Modified: 2019-10-22 14:35 UTC
From: bram dot esposito at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: Filesystem function related
PHP Version: 7.3.10 OS: Mac OSX / Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bram dot esposito at gmail dot com
New email:
PHP Version: OS:

 

 [2019-10-22 14:17 UTC] bram dot esposito at gmail dot com
Description:
------------
Reproduced in PHP 7.3.9 and 7.3.10.
Reproduced on Mac OS 10.14.6 and Debian 4.7.2-5.

This bug was not present in PHP 7.2.

Using a docx file generated from Google Drive. This issue is not present with docx files from MS Word.

finfo_file() does report the correct mime type for the file, but the string contains the mime type string twice.


Test script:
---------------
$file = __DIR__."/file-downloaded-from-google-drive.docx";
$finfo     = finfo_open( FILEINFO_MIME_TYPE );
$real_mime = finfo_file( $finfo, $file );
finfo_close( $finfo );
var_dump($real_mime);

Expected result:
----------------
finfo_file( $finfo, $file ) returning:
string(71) "application/vnd.openxmlformats-officedocument.wordprocessingml.document" 

Actual result:
--------------
finfo_file( $finfo, $file ) returning:
string(142) "application/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.wordprocessingml.document"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-22 14:35 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2019-10-22 14:35 UTC] cmb@php.net
Duplicate of bug #77784.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 13:01:24 2019 UTC