xref: /PHP-7.2/ext/zip/tests/bug7214.phpt (revision 1f655451)
1--TEST--
2Bug #7214 (zip_entry_read() binary safe)
3--SKIPIF--
4<?php
5/* $Id$ */
6if(!extension_loaded('zip')) die('skip');
7 ?>
8--FILE--
9<?php
10$zip = zip_open(dirname(__FILE__)."/binarynull.zip");
11if (!is_resource($zip)) die("Failure");
12$entries = 0;
13$entry = zip_read($zip);
14$contents = zip_entry_read($entry, zip_entry_filesize($entry));
15if (strlen($contents) == zip_entry_filesize($entry)) {
16	echo "Ok";
17} else {
18	echo "failed";
19}
20
21?>
22--EXPECT--
23Ok
24