From e7f541396715ee2895abcf73044b91ae9b746201 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Wed, 20 Dec 2017 18:09:53 +0100 Subject: Better parsing of the rules Thanks to this huge commit from @xXx-caillou-xXx, we can now write amazingly flexible rules.--- src/tests/disabled_function_local_var_10.phpt | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/tests/disabled_function_local_var_10.phpt (limited to 'src/tests/disabled_function_local_var_10.phpt') diff --git a/src/tests/disabled_function_local_var_10.phpt b/src/tests/disabled_function_local_var_10.phpt new file mode 100644 index 0000000..538d693 --- /dev/null +++ b/src/tests/disabled_function_local_var_10.phpt @@ -0,0 +1,44 @@ +--TEST-- +Disable functions - match on a local variable +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/disabled_function_local_var.ini +--FILE-- + Array('qwe'), '456' => Array('no block this')); +var_dump($qwe); +strlen("qwe"); +$qwe = Array('123' => Array('qwe'), '456' => Array(Array('block this'))); +var_dump($qwe); +strlen("qwe"); +?> +--EXPECTF-- +array(2) { + [123]=> + array(1) { + [0]=> + string(3) "qwe" + } + [456]=> + array(1) { + [0]=> + string(13) "no block this" + } +} +array(2) { + [123]=> + array(1) { + [0]=> + string(3) "qwe" + } + [456]=> + array(1) { + [0]=> + array(1) { + [0]=> + string(10) "block this" + } + } +} +[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strlen' in %a/tests/disabled_function_local_var_10.php:%d has been disabled. -- cgit v1.3