blob: dc0c71ed11984390b9b0210a14a709a3dcac9c56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--TEST--
Phar: set alias with invalid alias containing / \ : or ;
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.readonly=0
--FILE--
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
$p = new Phar($fname);
try {
$p->setAlias('hi/');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
try {
$p->setAlias('hi\\l');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
try {
$p->setAlias('hil;');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
try {
$p->setAlias(':hil');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
?>
--EXPECTF--
Invalid alias "hi/" specified for phar "%sinvalid_alias.phar"
Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar"
Invalid alias "hil;" specified for phar "%sinvalid_alias.phar"
Invalid alias ":hil" specified for phar "%sinvalid_alias.phar"
===DONE===
|