Bug #78720 [NEW]: finfo_file reports double mimetype

From: Date: Tue, 22 Oct 2019 14:17:16 +0000
Subject: Bug #78720 [NEW]: finfo_file reports double mimetype
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223380@lists.php.net to get a copy of this message
From:             bram dot esposito at gmail dot com
Operating system: Mac OSX / Linux
PHP version:      7.3.10
Package:          Filesystem function related
Bug Type:         Bug
Bug description:finfo_file reports double mimetype

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"

-- 
Edit bug report at https://bugs.php.net/bug.php?id=78720&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=78720&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=78720&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=78720&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=78720&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=78720&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=78720&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=78720&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=78720&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=78720&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=78720&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78720&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=78720&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=78720&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=78720&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=78720&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=78720&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=78720&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#223380) next »