xref: /PHP-8.1/ext/zip/tests/bug70752.phpt (revision 74859783)
1--TEST--
2Bug #70752 (Depacking with wrong password leaves 0 length files)
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.zip';
8$zip = new ZipArchive();
9$zip->open($filename);
10
11$filename =  __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
12var_dump(file_exists($filename));
13
14$zip->setPassword('bar'); // correct password would be 'foo'
15$zip->extractTo(__DIR__);
16$zip->close();
17
18var_dump(file_exists($filename));
19?>
20--EXPECT--
21bool(false)
22bool(false)
23--CLEAN--
24<?php
25$filename =  __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
26unlink($filename);
27?>
28