summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorjvoisin2017-10-24 00:16:30 +0200
committerjvoisin2017-10-24 00:16:30 +0200
commit92a4b93c4d420fefe590bd88521ec76d8bebd3fe (patch)
treec817f0cff179136fb4321822198481d05dde2c6c /src/tests
parentca51803abbe0b5605f936f5676d9c1a528713033 (diff)
Remove the `enable` member from the disable function structure
Also add some more tests
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/config/config_disabled_functions_param_r.ini1
-rw-r--r--src/tests/config/disabled_functions_pos.ini1
-rw-r--r--src/tests/config/disabled_functions_ret.ini1
-rw-r--r--src/tests/disabled_functions_param_pos.phpt3
4 files changed, 5 insertions, 1 deletions
diff --git a/src/tests/config/config_disabled_functions_param_r.ini b/src/tests/config/config_disabled_functions_param_r.ini
index 8e9ac63..09a59fe 100644
--- a/src/tests/config/config_disabled_functions_param_r.ini
+++ b/src/tests/config/config_disabled_functions_param_r.ini
@@ -1 +1,2 @@
1sp.disable_function.function("system").param_r("^not_command$").value("id").drop();
1sp.disable_function.function("system").param_r("^command$").value("id").drop(); 2sp.disable_function.function("system").param_r("^command$").value("id").drop();
diff --git a/src/tests/config/disabled_functions_pos.ini b/src/tests/config/disabled_functions_pos.ini
index f96cf3d..e7d12a9 100644
--- a/src/tests/config/disabled_functions_pos.ini
+++ b/src/tests/config/disabled_functions_pos.ini
@@ -1 +1,2 @@
1sp.disable_function.function("system").pos("1337").value("id").drop();
1sp.disable_function.function("system").pos("0").value("id").drop(); 2sp.disable_function.function("system").pos("0").value("id").drop();
diff --git a/src/tests/config/disabled_functions_ret.ini b/src/tests/config/disabled_functions_ret.ini
index 4afcd34..288177a 100644
--- a/src/tests/config/disabled_functions_ret.ini
+++ b/src/tests/config/disabled_functions_ret.ini
@@ -1,4 +1,5 @@
1sp.disable_function.function("testFunction").ret("0").drop().disable(); 1sp.disable_function.function("testFunction").ret("0").drop().disable();
2sp.disable_function.function("strpos").ret("0").drop().filename_r(".*\\.not_matching");
2sp.disable_function.function("strpos").ret("0").drop().filename_r(".*\\.php"); 3sp.disable_function.function("strpos").ret("0").drop().filename_r(".*\\.php");
3sp.disable_function.function_r("str[ia]pos").ret_r("^[^a-z]+$").drop(); 4sp.disable_function.function_r("str[ia]pos").ret_r("^[^a-z]+$").drop();
4sp.disable_function.function_r("stripos").ret_r("^[^a-z]+").drop(); 5sp.disable_function.function_r("stripos").ret_r("^[^a-z]+").drop();
diff --git a/src/tests/disabled_functions_param_pos.phpt b/src/tests/disabled_functions_param_pos.phpt
index de578b2..a1f8895 100644
--- a/src/tests/disabled_functions_param_pos.phpt
+++ b/src/tests/disabled_functions_param_pos.phpt
@@ -9,4 +9,5 @@ sp.configuration_file={PWD}/config/disabled_functions_pos.ini
9system("id"); 9system("id");
10?> 10?>
11--EXPECTF-- 11--EXPECTF--
12[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/disabled_functions_param_pos.php:%d has been disabled, because its argument 'command' content (id) matched a rule. 12[snuffleupagus][0.0.0.0][config][error] It seems that you wrote a rule filtering on the 0th argument of the function 'system', but it takes only 2 arguments. Matching on _all_ arguments instead.
13[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/disabled_functions_param_pos.php:2 has been disabled, because its argument 'command' content (id) matched a rule.