Bug #67731 [Opn->Csd]: finfo::file() returns invalid mime type for binary files
| From: | ab@php.net | Date: | Sat, 30 Aug 2014 02:07:07 +0000 |
| Subject: | Bug #67731 [Opn->Csd]: finfo::file() returns invalid mime type for binary files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187346@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67731&edit=1
ID: 67731
Updated by: ab@php.net
Reported by: norbert at linuxnetworks dot de
Summary: finfo::file() returns invalid mime type for binary
files
-Status: Open
+Status: Closed
Type: Bug
Package: Filesystem function related
Operating System: travis-ci
PHP Version: 5.6.0RC2
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c301467f9ba07384386fa0f61c0c63cb4da037d0
Log: Fixed bug #67731 finfo::file() returns invalid mime type for binary files
Previous Comments:
------------------------------------------------------------------------
[2014-08-29 23:15:37] florian at margaine dot com
Do you have a file example? I get application/x-executable on a simple compiled (so, binary) file.
Test case here if needed: https://github.com/Ralt/php-src/commit/5ddce3b13751a6a4e80f73b9df108137c6e40f9d
------------------------------------------------------------------------
[2014-07-31 21:10:38] norbert at linuxnetworks dot de
Description:
------------
Compared to PHP 5.3 to 5.5, version 5.6RC2 returns a different mime type for binary files:
"binary" instead of "application/octet-stream"
Test script:
---------------
$filename = '<name of binary file>';
$finfo = new finfo( FILEINFO_MIME_TYPE );
$mimetype = $finfo->file( $filename );
echo $mimetype . PHP_EOL;
Expected result:
----------------
PHP 5.3, 5.4, 5.5: application/octet-stream
Actual result:
--------------
PHP 5.6RC2: binary (invalid as all mimetypes are "type/subtype")
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67731&edit=1