mirror of
https://github.com/php/php-src.git
synced 2024-09-25 11:57:26 +00:00
20 lines
841 B
Plaintext
20 lines
841 B
Plaintext
|
--TEST--
|
||
|
PHP_Archive::mapPhar filesize mismatch
|
||
|
--SKIPIF--
|
||
|
<?php if (!extension_loaded("phar")) print "skip";?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
|
||
|
register_shutdown_function('cleanup');
|
||
|
$file = "<?php
|
||
|
PHP_Archive::mapPhar(5, 'hio', false);
|
||
|
__HALT_COMPILER(); ?>";
|
||
|
// compressed file length does not include 8 bytes for crc/file length and should
|
||
|
$manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
|
||
|
$file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 2) . 'a';
|
||
|
file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
|
||
|
include dirname(__FILE__) . '/008_phar.php';
|
||
|
echo file_get_contents('phar://hio/a');
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
Fatal error: file_get_contents(): phar error: internal corruption of phar "%s" (filesize mismatch on file "a") in %s on line 12
|