Bug #79394 [Opn->Nab]: mime_content_type Reporting Incorrectly Returning application/zlib
| From: | requinix@php.net | Date: | Wed, 18 Mar 2020 14:50:46 +0000 |
| Subject: | Bug #79394 [Opn->Nab]: mime_content_type Reporting Incorrectly Returning application/zlib | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226160@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79394&edit=1
ID: 79394
Updated by: requinix@php.net
Reported by: scott dot newman at faa dot gov
Summary: mime_content_type Reporting Incorrectly Returning
application/zlib
-Status: Open
+Status: Not a bug
Type: Bug
Package: Filesystem function related
Operating System: Red Hat 7.7
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2020-03-18 14:40:07] scott dot newman at faa dot gov
Description:
------------
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:
---------------
<?php
var_dump(mime_content_type("file.txt"));
?>
Expected result:
----------------
application/zlib is reported instead of text/plain.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79394&edit=1