diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2008-01-28 00:15:34 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2008-01-28 00:15:34 +0000 |
commit | eb7d6f05ffe630f74a964ae7713fcd4432cdfdde (patch) | |
tree | f3a95462245fea60d0cd6a8b88a0673267bb78c4 | |
parent | a44341a82281a3a55f7122b109931c6b56f6dfb2 (diff) | |
download | brdo-eb7d6f05ffe630f74a964ae7713fcd4432cdfdde.tar.gz brdo-eb7d6f05ffe630f74a964ae7713fcd4432cdfdde.tar.bz2 |
#206955 follow up by merlinofchaos: avoid misusing default values for image buttons
-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 9a28ddf73..2f84e69d4 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -985,7 +985,9 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com $form['#value'] = $function($form); } // Final catch. If we haven't set a value yet, use the explicit default value. - if (!isset($form['#value'])) { + // Avoid image buttons (which come with garbage value), so we only get value + // for the button actually clicked. + if (!isset($form['#value']) && empty($form['#has_garbage_value'])) { $form['#value'] = isset($form['#default_value']) ? $form['#default_value'] : ''; } } |