diff options
Diffstat (limited to 'src/tests/disabled_functions_param.phpt')
| -rw-r--r-- | src/tests/disabled_functions_param.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tests/disabled_functions_param.phpt b/src/tests/disabled_functions_param.phpt new file mode 100644 index 0000000..2309217 --- /dev/null +++ b/src/tests/disabled_functions_param.phpt | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_functions_param.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | system("id"); | ||
| 10 | system("echo win"); | ||
| 11 | var_dump(array_sum([1,2,3,4,5])); | ||
| 12 | shell_exec("id"); | ||
| 13 | echo shell_exec("echo 42"); | ||
| 14 | strcmp("bla", "ble"); | ||
| 15 | strncmp("bla", "ble", 2); | ||
| 16 | ?> | ||
| 17 | --EXPECTF-- | ||
| 18 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/disabled_functions_param.php:2 has been disabled, because its argument 'command' content (id) matched the rule '1'. | ||
| 19 | win | ||
| 20 | int(15) | ||
| 21 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'shell_exec' in %a/disabled_functions_param.php:5 has been disabled, because its argument 'cmd' content (id) matched the rule '3'. | ||
| 22 | 42 | ||
| 23 | [snuffleupagus][0.0.0.0][disabled_function][notice] The call to the function 'strcmp' in %a/tests/disabled_functions_param.php:7 has been disabled, because its argument 'str1' content (bla) matched the rule '5'. | ||
| 24 | [snuffleupagus][0.0.0.0][disabled_function][notice] The call to the function 'strncmp' in %a/tests/disabled_functions_param.php:8 has been disabled, because its argument 'str1' content (bla) matched a rule. | ||
