php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56472 Detection doesn't work on small files
Submitted: 2005-08-02 19:26 UTC Modified: 2005-10-23 05:57 UTC
From: mjs15451 at hotmail dot com Assigned:
Status: Not a bug Package: Fileinfo (PECL)
PHP Version: 5.0.3 OS: Gentoo
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 26 = ?
Subscribe to this entry?

 
 [2005-08-02 19:26 UTC] mjs15451 at hotmail dot com
Description:
------------
On a 1 byte text file, fileinfo returns this as a mimetype:
very short file (no magic)

Reproduce code:
---------------
$file = '/path/to/file/1bytefile.txt';
$info = new finfo(FILEINFO_MIME);
echo $info->file($file);

Expected result:
----------------
Should output text/plain; charset=charsetOfFile

Actual result:
--------------
Outputs: very short file (no magic)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-23 05:57 UTC] mike@php.net
Sorry, but your problem does not imply a bug in PECL itself.  For a
list of more appropriate places to ask for help using PECL, please
visit http://pecl.php.net/support/ as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

Actually a libmagic issue.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 11:03:34 2021 UTC