|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73006 String is recognized as zlib
Submitted: 2016-09-02 19:08 UTC Modified: 2016-09-02 20:28 UTC
From: rasi at xssn dot at Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 7.0.10 OS: Arch Linux 64bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rasi at xssn dot at
New email:
PHP Version: OS:


 [2016-09-02 19:08 UTC] rasi at xssn dot at
The string "(Singer/Songwriter) Andrea Schroeder                   Void" is reported as zlib mimetype by php.

Test script:
save above string in a file and use the following script to identify mimetype with php:


function mimetype($file) {
	$fileinfo = new finfo(FILEINFO_MIME_TYPE);
	$mimetype = $fileinfo->file($file);
	return $mimetype;

echo mimetype($argv[1]);

Expected result:
I expect mimetype text/plain

Actual result:
Actual result is application/zlib


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-02 19:19 UTC] rasi at xssn dot at
It's actually the "(S" at the start of the string that triggers this
 [2016-09-02 20:28 UTC]
-Status: Open +Status: Not a bug -Package: *General Issues +Package: Filesystem function related
 [2016-09-02 20:28 UTC]
"(S" 0x2853 are magic bytes for application/zlib data. We can't change that.

MIME typing is great and all but generally works best with binary files. Sometimes you should rely on file extensions instead.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 08 11:01:23 2021 UTC