Commit ba5c2c4d authored by alexpott's avatar alexpott
Browse files

Issue #1955282 by LewisNyman: Disable Autocapitalize and Autocorrect on user login forms.

parent bfd507f4
......@@ -40,7 +40,8 @@ public function form(array $form, array &$form_state) {
'#maxlength' => USERNAME_MAX_LENGTH,
'#description' => t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.'),
'#required' => TRUE,
'#attributes' => array('class' => array('username'), 'autocomplete' => 'off'),
'#attributes' => array('class' => array('username'), 'autocorrect' => 'off', 'autocomplete' => 'off', 'autocapitalize' => 'off',
'spellcheck' => 'false'),
'#default_value' => (!$register ? $account->name : ''),
'#access' => ($register || ($user->uid == $account->uid && user_access('change own username')) || $admin),
'#weight' => -10,
......
......@@ -1225,6 +1225,9 @@ function user_login_form($form, &$form_state) {
'#description' => t('Enter your @s username.', array('@s' => config('system.site')->get('name'))),
'#required' => TRUE,
'#attributes' => array(
'autocorrect' => 'off',
'autocapitalize' => 'off',
'spellcheck' => 'false',
'autofocus' => 'autofocus',
),
);
......
......@@ -29,6 +29,12 @@ function user_pass() {
'#size' => 60,
'#maxlength' => max(USERNAME_MAX_LENGTH, EMAIL_MAX_LENGTH),
'#required' => TRUE,
'#attributes' => array(
'autocorrect' => 'off',
'autocapitalize' => 'off',
'spellcheck' => 'false',
'autofocus' => 'autofocus',
),
);
// Allow logged in users to request this also.
if ($user->uid > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment