|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69107 finfo no longer detects PHP files
Submitted: 2015-02-23 09:19 UTC Modified: 2016-08-08 17:03 UTC
From: arjen at react dot com Assigned: cmb (profile)
Status: Closed Package: Filesystem function related
PHP Version: master-Git-2015-02-23 (Git) OS: Linux
Private report: No CVE-ID: None
 [2015-02-23 09:19 UTC] arjen at react dot com
Some PHP files are marked as 'text/plain', previously 'text/x-php'.


Test script:

$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"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-24 07:57 UTC] arjen at react dot com
This is fixed now, see

Please close issue or add as testcase.
 [2016-08-08 16:32 UTC]
-Assigned To: +Assigned To: cmb
 [2016-08-08 16:32 UTC]
For the record: this issue has most likely been fixed with

I'm going to add the regression test.
 [2016-08-08 17:03 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun May 28 15:03:42 2023 UTC