File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / zip / tests / pecl12414.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:11 2013 UTC (10 years, 11 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #12414 ( extracting files from damaged archives)
--SKIPIF--
<?php
/*$ */
if(!extension_loaded('zip')) die('skip');
 ?>
--FILE--
<?php
$filename = 'MYLOGOV2.GFX';
$zipname = dirname(__FILE__) . "/pecl12414.zip";
$za = new ZipArchive();
$res =$za->open($zipname);
if ($res === TRUE) {
	$finfo=$za->statName($filename);
	$file_size=$finfo['size'];

	if($file_size>0) {
		$contents=$za->getFromName($filename);

		echo "ZIP contents size: " . strlen($contents) . "\n";
		if(strlen($contents)!=$file_size) {
			echo "zip_readfile recorded data does not match unpacked size: " . $zipname . " : " . $filename;
		}
	} else {
		$contents=false;
		echo "zip_readfile could not open stream from zero length file " . $zipname . " : " .$filename;
	}

	$za->close();
} else {
	echo "zip_readfile could not read from " . $zipname . " : " . $filename;
}

?>
--DONE--
--EXPECTF--
zip_readfile could not read from %specl12414.zip : MYLOGOV2.GFX

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