Bug #80887 [Opn]: MIME type is changed for archives created by ZipArchive

From: Date: Fri, 19 Mar 2021 00:49:09 +0000
Subject: Bug #80887 [Opn]: MIME type is changed for archives created by ZipArchive
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232867@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80887&edit=1 ID: 80887 User updated by: kolesnikov dot p at hotmail dot com Reported by: kolesnikov dot p at hotmail dot com Summary: MIME type is changed for archives created by ZipArchive Status: Open Type: Bug Package: Zip Related Operating System: Linux PHP Version: 8.0.3 Block user comment: N Private report: N New Comment: Last line echo $info->file('test.zip') . PHP_EOL; Previous Comments: ------------------------------------------------------------------------ [2021-03-19 00:45:49] kolesnikov dot p at hotmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=80887&edit=1

« previous php.bugs (#232867) next »