summaryrefslogtreecommitdiff
path: root/src/tests/eval_whitelist_user_then_builtin.phpt
blob: 8db36fccca1c7e369a98c14d859d87f1c5f15dd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Eval whitelist - builtin function
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/eval_whitelist.ini
--FILE--
<?php 

function my_fun() {
	return sin(10);
}

$a = my_fun(1);
echo "Outside of eval: $a\n";
eval('$a = my_fun(5);');
echo "After allowed eval: $a\n";
eval('$a = my_fun(4);');
echo "After eval: $a\n";
?>
--EXPECTF--
Outside of eval: -0.54402111088937
[snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call.