Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
.drop() is now bailout
Browse files Browse the repository at this point in the history
Courtesy of @buixor
  • Loading branch information
jvoisin committed Oct 25, 2017
1 parent 30b900f commit 5c84131
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/sp_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void sp_execute_ex(zend_execute_data *execute_data) {
}

if (true == should_disable(execute_data)) {
return;
sp_terminate();
}

if (execute_data->func->op_array.type == ZEND_EVAL_CODE) {
Expand Down
4 changes: 1 addition & 3 deletions src/tests/disabled_functions_chain.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ echo "I'm after the call to outer\n";
--EXPECTF--
I'm before the call to outer
I'm in the outer function, before the call!
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain.php:%d has been disabled.
I'm in the outer function, after the call!
I'm after the call to outer
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain.php:%d has been disabled.
4 changes: 1 addition & 3 deletions src/tests/disabled_functions_chain_call_user_func.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ echo "I'm after the call to outer\n";
--EXPECTF--
I'm before the call to outer
I'm in the outer function, before the call!
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain_call_user_func.php:%d has been disabled.
I'm in the outer function, after the call!
I'm after the call to outer
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain_call_user_func.php:%d has been disabled.
2 changes: 0 additions & 2 deletions src/tests/disabled_functions_method.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ $c->method3("pouet");
?>
--EXPECTF--
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'AwesomeClass::method1' in %a/tests/disabled_functions_method.php:4 has been disabled.
method2:paf
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'AwesomeClass::method3' in %a/tests/disabled_functions_method.php:10 has been disabled, because its argument 'a' content (pouet) matched a rule.
8 changes: 1 addition & 7 deletions src/tests/disabled_functions_param_array.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,4 @@ foo($a);
?>
--EXPECTF--
test1
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '1'.
abcde
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '2'.
eee
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '3'.
cccc
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '4'.
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '1'.
4 changes: 0 additions & 4 deletions src/tests/disabled_functions_param_int.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ foobar("10");
--EXPECTF--
1
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (42) matched a rule.
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (1337) matched a rule.
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (13374242) matched a rule.
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (42) matched a rule.
10

0 comments on commit 5c84131

Please sign in to comment.