Bug #68731 [Asn]: finfo_buffer doesn't extract the correct mime with some gifs
| From: | sjaillet at gmail dot com | Date: | Sun, 04 Jan 2015 17:22:52 +0000 |
| Subject: | Bug #68731 [Asn]: finfo_buffer doesn't extract the correct mime with some gifs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189645@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68731&edit=1
ID: 68731
User updated by: sjaillet at gmail dot com
Reported by: sjaillet at gmail dot com
Summary: finfo_buffer doesn't extract the correct mime with
some gifs
Status: Assigned
Type: Bug
Package: Unknown/Other Function
Operating System: Ubuntu 14.04.1
PHP Version: 5.6.4
Assigned To: ab
Block user comment: N
Private report: N
New Comment:
Btw something seems to go wrong at the byte 516 since:
echo finfo_buffer($finfo, substr($buffer, 0, 515)); // Display
'image/gif' as
expected
echo finfo_buffer($finfo, substr($buffer, 0, 516)); // Display
'application/octet-stream'
Previous Comments:
------------------------------------------------------------------------
[2015-01-03 03:31:50] sjaillet at gmail dot com
Description:
------------
finfo_buffer doesn't extract the correct mime for gifs in PHP 5.6
Seems working as expected with PHP 5.5 & PHP 5.4
Test script:
---------------
$buffer = file_get_contents('http://s30.postimg.org/t89w8ep3x/favicon.gif');
$finfo = finfo_open(FILEINFO_MIME_TYPE);
echo finfo_buffer($finfo, $buffer);
Expected result:
----------------
Should display "image/gif"
Actual result:
--------------
"application/octet-stream"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68731&edit=1