xref: /php-src/ext/phar/tests/tar/badalias.phpt (revision 74859783)
1--TEST--
2Phar: invalid aliases
3--EXTENSIONS--
4phar
5zlib
6bz2
7--FILE--
8<?php
9$e = __DIR__ . '/files/';
10for ($i = 1; $i <= 5; $i++) {
11try {
12new Phar($e . "badalias$i.phar.tar");
13} catch (Exception $ee) {
14echo $ee->getMessage(), "\n";
15}
16}
17?>
18--EXPECTF--
19phar error: invalid alias "hi/thereaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." in tar-based phar "%sbadalias1.phar.tar"
20phar error: invalid alias "hi\there" in tar-based phar "%sbadalias2.phar.tar"
21phar error: invalid alias "hi;there" in tar-based phar "%sbadalias3.phar.tar"
22phar error: invalid alias "hi:there" in tar-based phar "%sbadalias4.phar.tar"
23phar error: tar-based phar "%sbadalias5.phar.tar" has alias that is larger than 511 bytes, cannot process
24