Annotation of embedaddon/php/ext/zip/tests/bug7214.phpt, revision 1.1.1.2

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>