summaryrefslogtreecommitdiff
path: root/src/tests/eval_whitelist_include_then_user.phpt
blob: 6d4e36a90052c9a76b9fdab765582ed0bae4937f (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
--TEST--
Eval whitelist - builtin function
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/eval_whitelist.ini
--FILE--
<?php 
$b = 1337;
$dir = __DIR__;

file_put_contents($dir . '/test.bla', '<?php $b = sin(1) ?>');

$a = cos(1);
echo "Outside of eval: $a\n";
eval('$a = cos(5);');
echo "After allowed eval: $a\n";
eval("include_once('$dir' . '/test.bla');");
echo "After eval: $b\n";
?>
--CLEAN--
<?php
$dir = __DIR__;
unlink($dir . '/test.bla');
?>
--EXPECTF--
Outside of eval: 0.54030230586814
After allowed eval: 0.28366218546323
[snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call.