blob: 82abe02b296099fed78f7ea00ef6730044087a19 (
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
|
--TEST--
Eval whitelist/blacklist, on builtin functions
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/eval_whitelist_blacklist.ini
--FILE--
<?php
function my_fun($p) {
return "my_fun: $p";
}
$a = tan(1);
echo "Outside of eval: $a\n";
eval('$a = tan(1);');
echo "After allowed eval: $a\n";
eval('$a = cos(1234);');
echo "After eval: $a\n";
?>
--EXPECTF--
Outside of eval: 1.5574077246549
After allowed eval: 1.5574077246549
Fatal error: [snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'cos' isn't in the eval whitelist, dropping its call. in %a/eval_backlist_whitelist_builtin.php(10) : eval()'d code on line 1
|