|  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:
Solve the problem:
47 - 23 = ?
Subscribe to this entry?

 [2005-08-02 19:26 UTC] mjs15451 at hotmail dot com
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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-23 05:57 UTC]
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 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-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 21 17:01:30 2024 UTC