Bug #74573 [Opn->Nab]: finfo_file apk
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)