summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2014-12-01 18:33:09 -0500
committerDavid Rothstein <drothstein@gmail.com>2014-12-01 18:33:09 -0500
commit8bbc2d2ea0bfb6cf12f5f6f3edf82cca6429d046 (patch)
tree54ca4e1dc49517a556107c237c77ee5355c648d0 /modules/system
parentde8762b201863542b1867737997a45c7100b8f2f (diff)
downloadbrdo-8bbc2d2ea0bfb6cf12f5f6f3edf82cca6429d046.tar.gz
brdo-8bbc2d2ea0bfb6cf12f5f6f3edf82cca6429d046.tar.bz2
Issue #2380053 by klausi, pwolanin, tsphethean, sun, David_Rothstein: Posting an array as value of a form element is allowed even when a string is expected (and bypasses #maxlength constraints) - first step: text fields
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.module6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index a27493579..6a6200ea1 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -374,6 +374,9 @@ function system_element_info() {
'#element_validate' => array('form_validate_machine_name'),
'#theme' => 'textfield',
'#theme_wrappers' => array('form_element'),
+ // Use the same value callback as for textfields; this ensures that we only
+ // get string values.
+ '#value_callback' => 'form_type_textfield_value',
);
$types['password'] = array(
'#input' => TRUE,
@@ -382,6 +385,9 @@ function system_element_info() {
'#process' => array('ajax_process_form'),
'#theme' => 'password',
'#theme_wrappers' => array('form_element'),
+ // Use the same value callback as for textfields; this ensures that we only
+ // get string values.
+ '#value_callback' => 'form_type_textfield_value',
);
$types['password_confirm'] = array(
'#input' => TRUE,