From 92914245608123f9e011d1e9d4cf8c057bc9e8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 23 Aug 2007 18:02:52 +0000 Subject: #169247 by profix898 slightly modified: fix E_NOTICE when form_id is not set on a non-programmed form --- includes/form.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'includes') 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'])) { -- cgit v1.2.3