Bug #69107 [Asn->Csd]: finfo no longer detects PHP files
| From: | cmb@php.net | Date: | Mon, 08 Aug 2016 17:03:56 +0000 |
| Subject: | Bug #69107 [Asn->Csd]: finfo no longer detects PHP files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203091@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69107&edit=1
ID: 69107
Updated by: cmb@php.net
Reported by: arjen at react dot com
Summary: finfo no longer detects PHP files
-Status: Assigned
+Status: Closed
Type: Bug
Package: Filesystem function related
Operating System: Linux
PHP Version: master-Git-2015-02-23 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Test added: <http://git.php.net/?p=php-src.git;a=commit;h=243d5fcb>.
Previous Comments:
------------------------------------------------------------------------
[2016-08-08 16:32:28] cmb@php.net
For the record: this issue has most likely been fixed with
<https://github.com/php/php-src/commit/10367fa7>.
I'm going to add the regression test.
------------------------------------------------------------------------
[2015-04-24 07:57:53] arjen at react dot com
This is fixed now, see http://3v4l.org/2ZP6h
Please close issue or add as testcase.
------------------------------------------------------------------------
[2015-02-23 09:19:07] arjen at react dot com
Description:
------------
Some PHP files are marked as 'text/plain', previously 'text/x-php'.
See http://3v4l.org/2ZP6h
Test script:
---------------
<?php
$finfo = new finfo(FILEINFO_MIME_TYPE);
var_dump($finfo->buffer("<?php\nclass A{}"));
var_dump($finfo->buffer("<?php class A{}"));
var_dump($finfo->buffer("<?php\tclass A{}"));
var_dump($finfo->buffer("<?php\n\rclass A{}"));
Expected result:
----------------
string(10) "text/x-php"
string(10) "text/x-php"
string(10) "text/x-php"
string(10) "text/x-php"
Actual result:
--------------
string(10) "text/plain"
string(10) "text/x-php"
string(10) "text/x-php"
string(10) "text/x-php"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69107&edit=1