|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mjs15451 at hotmail dot com
New email:
PHP Version: OS:


 [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: Wed Jun 19 17:01:33 2024 UTC