Bug #78720 [Opn->Dup]: finfo_file reports double mimetype

From: Date: Tue, 22 Oct 2019 14:35:13 +0000
Subject: Bug #78720 [Opn->Dup]: finfo_file reports double mimetype
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223381@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78720&edit=1 ID: 78720 Updated by: cmb@php.net Reported by: bram dot esposito at gmail dot com Summary: finfo_file reports double mimetype -Status: Open +Status: Duplicate Type: Bug Package: Filesystem function related Operating System: Mac OSX / Linux PHP Version: 7.3.10 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Duplicate of bug #77784. Previous Comments: ------------------------------------------------------------------------ [2019-10-22 14:17:15] 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" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78720&edit=1

« previous php.bugs (#223381) next »