php-src/ext/phar/tests/008.phpt

22 lines
656 B
Plaintext
Raw Normal View History

2005-12-08 07:49:47 +00:00
--TEST--
Phar::mapPhar truncated manifest (not enough for manifest length)
2005-12-08 07:49:47 +00:00
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip");?>
2005-12-08 07:49:47 +00:00
--FILE--
<?php
$file = "<?php
Phar::mapPhar('hio');
2005-12-08 07:49:47 +00:00
__HALT_COMPILER(); ?>";
$file .= pack('V', 500) . 'notenough';
2006-01-04 16:43:42 +00:00
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
try {
2006-01-04 16:43:42 +00:00
include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
} catch (Exception $e) {
echo $e->getMessage();
}
?>
2006-01-04 16:43:42 +00:00
--CLEAN--
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
2005-12-08 07:49:47 +00:00
--EXPECTF--
internal corruption of phar "%s" (truncated manifest header)