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

// Just in case
@unlink($dir . '/test.bla');

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";
?>
--EXPECTF--
Outside of eval: 0.54030230586814
After allowed eval: 0.28366218546323

Fatal error: [snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call. in %a/test.bla on line 1