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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC