Bug #74573 [Opn->Nab]: finfo_file apk

From: Date: Thu, 11 May 2017 15:31:30 +0000
Subject: Bug #74573 [Opn->Nab]: finfo_file apk
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209064@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74573&edit=1

 ID:                 74573
 Updated by:         requinix@php.net
 Reported by:        209721949 at qq dot com
 Summary:            finfo_file apk
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 Operating System:   mac
 PHP Version:        7.1.4
 Block user comment: N
 Private report:     N

 New Comment:

.apk files are ZIP archives. Without looking at the extension or the actual contents of the archive
it's impossible to tell the difference between the two.

MIME detection is not perfect. Sometimes you need to check the extension too.


Previous Comments:
------------------------------------------------------------------------
[2017-05-11 15:28:04] spam2 at rhsoft dot net

problem likely is the forked libmagic which don't get updates over ages and you can't even
rebuild from the system libmagic because different versions so "/usr/bin/php
ext/fileinfo/create_data_file.php /usr/share/misc/magic.mgc > ext/fileinfo/data_file.c"
within the build process results in a sucessful but unusable build

https://bugs.php.net/bug.php?id=67516

------------------------------------------------------------------------
[2017-05-11 15:21:06] 209721949 at qq dot com

Description:
------------
i use finfo_file to get the apk file mime type, but it always return application/zip but not
application/vnd.android

Test script:
---------------
$finfo = finfo_open(FILEINFO_MIME_TYPE); extension

$filename="xxx.apk";
echo finfo_file($finfo, $filename);

finfo_close($finfo);

Expected result:
----------------
i'm not sure if it's a bug, i just want to get the right result.



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



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


Thread (10 messages)

« previous php.bugs (#209064) next »