xref: /PHP-8.2/ext/zip/tests/bug81420.phpt (revision 218a93b8)
1--TEST--
2Bug #81420 (ZipArchive::extractTo extracts outside of destination)
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7$zip = new ZipArchive();
8$zip->open(__DIR__ . "/bug81420.zip");
9$destination = __DIR__ . "/bug81420";
10mkdir($destination);
11$zip->extractTo($destination);
12var_dump(file_exists("$destination/nt1/zzr_noharm.php"));
13?>
14--CLEAN--
15<?php
16$destination = __DIR__ . "/bug81420";
17@unlink("$destination/nt1/zzr_noharm.php");
18@rmdir("$destination/nt1");
19@rmdir($destination);
20?>
21--EXPECT--
22bool(true)
23