summaryrefslogtreecommitdiff
path: root/src/tests/disabled_functions_runtime.phpt
blob: 1c6a1415c4d3e4b849a6ff957fa67f8a58aba6d0 (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
--TEST--
Disable functions - runtime inclusion
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini
--FILE--
<?php 

$dir = __DIR__;
$content = '<?php function test($param) { echo $param . "\n"; }';
file_put_contents('file_to_include1.php', $content);
file_put_contents('file_to_include2.php', $content);

if (rand() % 2) {
    include "file_to_include1.php";
} else {
    include "file_to_include2.php";
}

test('1338');test('1337');

?>
--EXPECTF--
1338
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'test' in %a has been disabled, because its argument 'param' content (1337) matched a rule.
--CLEAN--
<?php
unlink("file_to_include1.php");
unlink("file_to_include2.php");
?>