php-src/ext/zip/tests/bug49072.phpt
Nikita Popov 7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

21 lines
483 B
PHP

--TEST--
Bug #49072 (feof never returns true for damaged file in zip)
--EXTENSIONS--
zip
--FILE--
<?php
$f = __DIR__ . '/bug49072.zip';
$o = new ZipArchive();
if (! $o->open($f, ZipArchive::CHECKCONS)) {
exit ('error can\'t open');
}
$r = $o->getStream('file1'); // this file has a wrong crc
if (!$r)die('failed to open a stream for file1');
$s = '';
while (! feof($r)) {
$s .= fread($r,1024);
}
?>
--EXPECTF--
Warning: fread(): Zip stream error: CRC error in %s on line %d