--- PasswordConfirm.php 2015-01-11 12:44:24.359012740 +0530 +++ backup.php 2015-01-11 12:45:16.783011670 +0530 @@ -81,6 +81,10 @@ if (strcmp($pass1, $pass2)) { $form_state->setError($element, t('The specified passwords do not match.')); } + // Check if password contains at least 6 characters + if (strlen($pass1) < 6) { + $form_state->setError($element, t('Your password must contain at least 6 characters.')); + } } elseif ($element['#required'] && $form_state->getUserInput()) { $form_state->setError($element, t('Password field is required.'));