diff options
| author | jvoisin | 2017-12-28 18:25:57 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-28 18:25:57 +0100 |
| commit | 06cc3a7ee98ece291bf6697cc652d7091b9f4ed1 (patch) | |
| tree | b39ad139f8480b98c7fbd930327a9cad3beca829 | |
| parent | 4358437e05c567da3226a5b7288de680d34fb523 (diff) | |
Add two test to prove that we're not prone to old-school bypasses
| -rw-r--r-- | src/tests/disabled_functions_register_shutdown_function.phpt | 18 | ||||
| -rw-r--r-- | src/tests/disabled_functions_register_tick_function.phpt | 18 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/disabled_functions_register_shutdown_function.phpt b/src/tests/disabled_functions_register_shutdown_function.phpt new file mode 100644 index 0000000..f209202 --- /dev/null +++ b/src/tests/disabled_functions_register_shutdown_function.phpt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - Called with register_shutdown_function | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_user_functions_die.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function my_super_function() { | ||
| 10 | echo 'lose'; | ||
| 11 | } | ||
| 12 | echo 1337; | ||
| 13 | register_shutdown_function('my_super_function'); | ||
| 14 | ?> | ||
| 15 | --EXPECTF-- | ||
| 16 | 1337 | ||
| 17 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'die' in %a/tests/disabled_functions_register_shutdown_function.php:%d has been disabled. | ||
| 18 | --XFAIL-- | ||
diff --git a/src/tests/disabled_functions_register_tick_function.phpt b/src/tests/disabled_functions_register_tick_function.phpt new file mode 100644 index 0000000..1d18c07 --- /dev/null +++ b/src/tests/disabled_functions_register_tick_function.phpt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - Called with register_tick_function | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_disabled_user_functions_die.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function my_super_function() { | ||
| 10 | echo 'lose'; | ||
| 11 | } | ||
| 12 | echo 1337; | ||
| 13 | register_tick_function('my_super_function'); | ||
| 14 | ?> | ||
| 15 | --EXPECTF-- | ||
| 16 | 1337 | ||
| 17 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'die' in %a/tests/disabled_functions_register_tick_function.php:%d has been disabled. | ||
| 18 | --XFAIL-- | ||
