|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2020-03-10 15:20 UTC] dv dot sum0 at gmail dot com
[2020-03-19 13:30 UTC] remi@php.net
[2020-03-19 13:30 UTC] remi@php.net
-Status: Open
+Status: Feedback
[2020-03-19 16:30 UTC] remi@php.net
-Summary: ZipArchive::open with ZipArchive::CREATE flag fail
when in the Mac OS TMPDIR
+Summary: ZipArchive::open fails on empty file (libzip 1.6.0)
[2020-03-19 16:38 UTC] remi@php.net
[2020-03-19 16:39 UTC] remi@php.net
[2020-03-20 10:19 UTC] remi@php.net
[2020-03-20 10:19 UTC] remi@php.net
-Status: Feedback
+Status: Closed
[2020-03-20 10:39 UTC] remi@php.net
[2021-01-20 15:26 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 18:00:02 2025 UTC |
Description: ------------ Creating a Zip archive in the default temporary directory of Mac OS doesn't work with Mac OS Catalina. Using the default TMPDIR to store temporary Zip archive, is a common practice. For instance it's what PHP WebDriver does by default to create a temporary Firefox profile. Using the OVERWRITE flag of libzip instead of the CREATE one fixes the problem. This may be due do to the new security features introduced in Mac OS Catalina. Tested with PHP 7.4 and 8.0-dev, but this bug probably affects all versions. Test script: --------------- <?php $f = tempnam(sys_get_temp_dir(), 'WebDriverFirefoxProfileZip'); $zip = new ZipArchive(); $success = $zip->open($f, ZipArchive::CREATE); // this work // $success = $zip->open($f, ZipArchive::OVERWRITE); if ($success !== true) { die('Error code '.$success); } $zip->addFile(__DIR__.'/foo.txt', '/foo.txt'); $zip->close(); Expected result: ---------------- No errors Actual result: -------------- Error 19 #define ZIP_ER_NOZIP 19 /* N Not a zip archive */