Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-8781 ZipArchive::close deletes zip file without updating stat …
…cache
- Loading branch information
1 parent
1cd8074
commit 390538a
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Bug GH-8781 (ZipArchive deletes zip file with no contents) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('zip')) die('skip zip extension not available'); | ||
?> | ||
--FILE-- | ||
<?php | ||
touch($file = __DIR__ . '/bug_gh8781.zip'); | ||
var_dump(is_file($file)); | ||
|
||
$zip = new ZipArchive(); | ||
$zip->open($file, ZipArchive::CREATE | ZipArchive::OVERWRITE); | ||
$zip->close(); | ||
|
||
var_dump(is_file($file)); | ||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(false) | ||
|