diff options
Diffstat (limited to 'ext/phar/tests')
| -rw-r--r-- | ext/phar/tests/bug60164.phpt | 21 | ||||
| -rw-r--r-- | ext/phar/tests/files/stuboflength1041.phar | bin | 0 -> 1168 bytes | |||
| -rw-r--r-- | ext/phar/tests/files/stuboflength1041.phar.inc | 42 |
3 files changed, 63 insertions, 0 deletions
diff --git a/ext/phar/tests/bug60164.phpt b/ext/phar/tests/bug60164.phpt new file mode 100644 index 0000000000..8fd5de5146 --- /dev/null +++ b/ext/phar/tests/bug60164.phpt @@ -0,0 +1,21 @@ +--TEST-- +Phar: verify stub of specific length does not break __HALT_COMPILER(); scanning in php +--SKIPIF-- +<?php +if (!extension_loaded("phar")) die("skip"); +?> +--INI-- +phar.require_hash=0 +phar.readonly=0 +--FILE-- +<?php +$phar = __DIR__ . '/files/stuboflength1041.phar'; +foreach (new RecursiveIteratorIterator(new Phar($phar, null, 'stuboflength1041.phar')) as $item) { + var_dump($item->getFileName()); +} +?> +===DONE=== +--EXPECT-- +string(5) "a.php" +string(5) "b.php" +===DONE===
\ No newline at end of file diff --git a/ext/phar/tests/files/stuboflength1041.phar b/ext/phar/tests/files/stuboflength1041.phar Binary files differnew file mode 100644 index 0000000000..d90fb8f10d --- /dev/null +++ b/ext/phar/tests/files/stuboflength1041.phar diff --git a/ext/phar/tests/files/stuboflength1041.phar.inc b/ext/phar/tests/files/stuboflength1041.phar.inc new file mode 100644 index 0000000000..4a26a41a09 --- /dev/null +++ b/ext/phar/tests/files/stuboflength1041.phar.inc @@ -0,0 +1,42 @@ +<?php + +@unlink(__DIR__ . '/stuboflength1041.phar'); + +$phar = new Phar('./stuboflength1041.phar'); +$phar['a.php'] = 'hi1'; +$phar['b.php'] = 'hi2'; + +$phar->setStub('<?php +/***stub of length 1041 including the halt compiler********************************************* +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +*********************************************/ +__HALT_COMPILER();'); +<?php + +@unlink(__DIR__ . '/stuboflength1041.phar'); + +$phar = new Phar('./stuboflength1041.phar'); +$phar['a.php'] = 'hi1'; +$phar['b.php'] = 'hi2'; + +$phar->setStub('<?php +/***stub of length 1041 including the halt compiler********************************************* +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +************************************************************************************************ +*********************************************/ +__HALT_COMPILER();');
\ No newline at end of file |
