diff options
-rw-r--r-- | includes/form.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc index 2392184d5..0bbc04867 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -295,7 +295,9 @@ function drupal_process_form($form_id, &$form, &$form_state) { $form_state['values'] = array(); $form = form_builder($form_id, $form, $form_state); - if ((!empty($form['#programmed'])) || (!empty($form['#post']) && (($form['#post']['form_id'] == $form_id)))) { + // Only process the form if it is programmed or the form_id coming + // from the POST data is set and matches the current form_id. + if ((!empty($form['#programmed'])) || (!empty($form['#post']) && (isset($form['#post']['form_id']) && ($form['#post']['form_id'] == $form_id)))) { drupal_validate_form($form_id, $form, $form_state); if ((!empty($form_state['submitted'])) && !form_get_errors() && empty($form_state['rebuild'])) { |