Bug #69107 [Opn]: finfo no longer detects PHP files

From: Date: Mon, 08 Aug 2016 16:32:29 +0000
Subject: Bug #69107 [Opn]: finfo no longer detects PHP files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203090@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:             Open
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Linux
 PHP Version:        master-Git-2015-02-23 (Git)
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.bugs (#203090) next »