Bug #71064 [NEW]: open($string, ZipArchive::OVERWRITE) does not create non-existing archives

From: Date: Tue, 08 Dec 2015 14:56:17 +0000
Subject: Bug #71064 [NEW]: open($string, ZipArchive::OVERWRITE) does not create non-existing archives
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197701@lists.php.net to get a copy of this message
From: php at rachuth dot de Operating system: * PHP version: 5.6.16 Package: Zip Related Bug Type: Bug Bug description:open($string, ZipArchive::OVERWRITE) does not create non-existing archives Description: ------------ There is an issue with the ZipArchive class' open() method. In previous versions of PHP when the only flag passed to the method was the ZipArchive::OVERWRITE, the method also created non-existing archives. Since PHP 5.6 the OVERWRITE flag alone cannot create new archives which breaks compatibility. Test script: --------------- // Open new archive in cwd based on timestamp $zip = new ZipArchive(); $open = $zip->open(time() . '.zip', ZipArchive::OVERWRITE); echo $open; Expected result: ---------------- Expected behavior: The new archive is opened as in the previous version. Actual result: -------------- In PHP 5.5 an empty archive is opened. In PHP 5.6 ZipArchive::ER_OPEN error code is returned (cannot open zip file). -- Edit bug report at https://bugs.php.net/bug.php?id=71064&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71064&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71064&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71064&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71064&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71064&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71064&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71064&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71064&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71064&r=support Expected behavior: https://bugs.php.net/fix.php?id=71064&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71064&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71064&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71064&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71064&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71064&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71064&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71064&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71064&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71064&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71064&r=mysqlcfg

« previous php.bugs (#197701) next »