Bug #69107 [NEW]: finfo no longer detects PHP files
| From: | arjen at react dot com | Date: | Mon, 23 Feb 2015 09:19:08 +0000 |
| Subject: | Bug #69107 [NEW]: finfo no longer detects PHP files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190904@lists.php.net to get a copy of this message | ||
From: arjen at react dot com
Operating system: Linux
PHP version: master-Git-2015-02-23 (Git)
Package: Filesystem function related
Bug Type: Bug
Bug description:finfo no longer detects PHP files
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 bug report at https://bugs.php.net/bug.php?id=69107&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69107&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69107&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69107&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69107&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69107&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69107&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69107&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69107&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69107&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69107&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69107&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69107&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69107&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69107&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69107&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69107&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69107&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69107&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69107&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69107&r=mysqlcfg