|  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
 [2019-10-22 14:17 UTC] bram dot esposito at gmail dot com
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 );

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"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-22 14:35 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2019-10-22 14:35 UTC]
Duplicate of bug #77784.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 14:01:29 2024 UTC