Skip to content

Commit 5664ae8

Browse files
meletisfMeletios Flevarakis
andauthored
Verify exception on ZipArchive::getExternalAttributesName when $name is empty (#7230)
Co-authored-by: Meletios Flevarakis <[email protected]>
1 parent e80dbd5 commit 5664ae8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
ZipArchive::getExternalAttributesName() throws a ValueError when the $name param is empty
3+
--EXTENSIONS--
4+
zip
5+
--FILE--
6+
<?php
7+
8+
$zip = new ZipArchive();
9+
$dirname = __DIR__ . '/';
10+
11+
$zip->open($dirname . "test.zip", ZIPARCHIVE::CREATE);
12+
13+
$a = ZipArchive::OPSYS_DEFAULT;
14+
$b = ZipArchive::OPSYS_DEFAULT;
15+
16+
try {
17+
$zip->getExternalAttributesName("", $a, $b);
18+
} catch(ValueError $e) {
19+
echo $e->getMessage();
20+
}
21+
?>
22+
--EXPECT--
23+
ZipArchive::getExternalAttributesName(): Argument #1 ($name) cannot be empty

0 commit comments

Comments
 (0)