mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
- MFB: #40228, ZipArchive::extractTo does create empty directories
recursively
This commit is contained in:
parent
db22b925bf
commit
1a78358460
3 changed files with 41 additions and 11 deletions
23
ext/zip/tests/bug40228.phpt
Normal file
23
ext/zip/tests/bug40228.phpt
Normal file
|
@ -0,0 +1,23 @@
|
|||
--TEST--
|
||||
Bug #40228 (extractTo does not create recursive empty path)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("zip")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dest = dirname(__FILE__);
|
||||
$arc_name = $dest . "/bug40228.zip";
|
||||
$zip = new ZipArchive;
|
||||
$zip->open($arc_name, ZIPARCHIVE::CREATE);;
|
||||
$zip->extractTo($dest);
|
||||
if (is_dir($dest . '/test/empty')) {
|
||||
echo "Ok\n";
|
||||
rmdir($dest . '/test/empty');
|
||||
rmdir($dest . '/test');
|
||||
} else {
|
||||
echo "Failed.\n";
|
||||
}
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
Done
|
BIN
ext/zip/tests/bug40228.zip
Normal file
BIN
ext/zip/tests/bug40228.zip
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue