Skip to content

Commit c84f7e8

Browse files
committed
Merge pull request pressflow#10 from dawehner/form-callbable
Make it possible to use any kind of callable as submit handlers
2 parents 8c70857 + 8417887 commit c84f7e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/form.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
817817
}
818818

819819
foreach ($handlers as $function) {
820-
if (function_exists($function)) {
820+
if (is_callable($function)) {
821821
// Check to see if a previous _submit handler has set a batch, but
822822
// make sure we do not react to a batch that is already being processed
823823
// (for instance if a batch operation performs a drupal_execute()).
@@ -828,7 +828,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
828828
$batch['sets'][] = array('form_submit' => $function);
829829
}
830830
else {
831-
$function($form, $form_state);
831+
call_user_func_array($function, array($form, &$form_state));
832832
}
833833
$return = TRUE;
834834
}

0 commit comments

Comments
 (0)