|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79394 mime_content_type Reporting Incorrectly Returning application/zlib
Submitted: 2020-03-18 14:40 UTC Modified: 2020-03-18 14:50 UTC
From: scott dot newman at faa dot gov Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: Irrelevant OS: Red Hat 7.7
Private report: No CVE-ID: None
 [2020-03-18 14:40 UTC] scott dot newman at faa dot gov
PHP Version is 7.1.23 but the drop down wouldn't let me select it. Version 7.1.23 is the version that's in the repository for RedHat 7 so I think it's still relevant.

To reproduce:
1) Create a text file that has content starting with "HK".
2) Use the PHP function "mime_content_type" to display the mime type.
3) The function incorrectly reports "application/zlib".

Test script:



Expected result:
application/zlib is reported instead of text/plain.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-18 14:50 UTC]
-Status: Open +Status: Not a bug
 [2020-03-18 14:50 UTC]
MIME type detection works by reading the first few bytes of a file and looking them up in a database. "HK" can indicate application/zlib files.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri May 14 16:01:23 2021 UTC