Bug #80887 [NEW]: MIME type is changed for archives created by ZipArchive
| From: | kolesnikov dot p at hotmail dot com | Date: | Fri, 19 Mar 2021 00:45:49 +0000 |
| Subject: | Bug #80887 [NEW]: MIME type is changed for archives created by ZipArchive | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232866@lists.php.net to get a copy of this message | ||
From: kolesnikov dot p at hotmail dot com
Operating system: Linux
PHP version: 8.0.3
Package: Zip Related
Bug Type: Bug
Bug description:MIME type is changed for archives created by ZipArchive
Description:
------------
In PHP 7 zip archive created with ZipArchive has MIME type
'application/zip'.
In PHP 8 MIME type is 'application/octet-stream'
Test script:
---------------
<?php
unlink('test.zip');
$zip = new ZipArchive();
$zip->open('test.zip', ZipArchive::CREATE);
$zip->addFromString('test.txt', 'file content goes here');
$zip->close();
$info = new finfo(FILEINFO_MIME_TYPE);
echo $info->file('test1.zip') . PHP_EOL;
Expected result:
----------------
application/zip
Actual result:
--------------
PHP7: application/zip
PHP8: application/octet-stream
--
Edit bug report at https://bugs.php.net/bug.php?id=80887&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80887&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80887&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80887&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80887&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80887&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80887&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80887&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80887&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80887&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80887&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80887&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80887&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80887&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80887&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80887&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80887&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80887&r=mysqlcfg