Bug #73006 [Opn->Nab]: String is recognized as zlib

From: Date: Fri, 02 Sep 2016 20:28:08 +0000
Subject: Bug #73006 [Opn->Nab]: String is recognized as zlib
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203759@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73006&edit=1

 ID:                 73006
 Updated by:         requinix@php.net
 Reported by:        rasi at xssn dot at
 Summary:            String is recognized as zlib
-Status:             Open
+Status:             Not a bug
 Type:               Bug
-Package:            *General Issues
+Package:            Filesystem function related
 Operating System:   Arch Linux 64bit
 PHP Version:        7.0.10
 Block user comment: N
 Private report:     N

 New Comment:

"(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.


Previous Comments:
------------------------------------------------------------------------
[2016-09-02 19:19:28] rasi at xssn dot at

It's actually the "(S" at the start of the string that triggers this

------------------------------------------------------------------------
[2016-09-02 19:08:18] rasi at xssn dot at

Description:
------------
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:

<?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


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73006&edit=1


Thread (3 messages)

« previous php.bugs (#203759) next »