summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2008-01-28 00:15:34 (GMT)
committerGábor Hojtsy2008-01-28 00:15:34 (GMT)
commiteb7d6f05ffe630f74a964ae7713fcd4432cdfdde (patch)
treef3a95462245fea60d0cd6a8b88a0673267bb78c4
parenta44341a82281a3a55f7122b109931c6b56f6dfb2 (diff)
#206955 follow up by merlinofchaos: avoid misusing default values for image buttons
-rw-r--r--includes/form.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 9a28ddf..2f84e69 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'] : '';
}
}