xref: /PHP-8.1/ext/zip/tests/bug7214.phpt (revision 74859783)
1--TEST--
2Bug #7214 (zip_entry_read() binary safe)
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7$zip = zip_open(__DIR__."/binarynull.zip");
8if (!is_resource($zip)) die("Failure");
9$entries = 0;
10$entry = zip_read($zip);
11$contents = zip_entry_read($entry, zip_entry_filesize($entry));
12if (strlen($contents) == zip_entry_filesize($entry)) {
13    echo "Ok";
14} else {
15    echo "failed";
16}
17
18?>
19--EXPECTF--
20Deprecated: Function zip_open() is deprecated in %s on line %d
21
22Deprecated: Function zip_read() is deprecated in %s on line %d
23
24Deprecated: Function zip_entry_filesize() is deprecated in %s on line %d
25
26Deprecated: Function zip_entry_read() is deprecated in %s on line %d
27
28Deprecated: Function zip_entry_filesize() is deprecated in %s on line %d
29Ok
30