diff options
Diffstat (limited to 'ext/zip/tests/bug7214.phpt')
| -rw-r--r-- | ext/zip/tests/bug7214.phpt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/zip/tests/bug7214.phpt b/ext/zip/tests/bug7214.phpt new file mode 100644 index 0000000..f791b79 --- /dev/null +++ b/ext/zip/tests/bug7214.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #7214 (zip_entry_read() binary safe) +--SKIPIF-- +<?php +/* $Id$ */ +if(!extension_loaded('zip')) die('skip'); + ?> +--FILE-- +<?php +$zip = zip_open(dirname(__FILE__)."/binarynull.zip"); +if (!is_resource($zip)) die("Failure"); +$entries = 0; +$entry = zip_read($zip); +$contents = zip_entry_read($entry, zip_entry_filesize($entry)); +if (strlen($contents) == zip_entry_filesize($entry)) { + echo "Ok"; +} else { + echo "failed"; +} + +?> +--EXPECT-- +Ok |
