Active
Project:
Password tab
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2017 at 21:12 UTC
Updated:
6 Apr 2017 at 21:13 UTC
Jump to comment: Most recent
This is the validation code:
/**
* Password change form validation.
*/
function password_tab_validate($form, &$form_state) {
$pass = trim($form_state['values']['pass']);
if (empty($pass)) {
form_set_error('pass', t('Your password cannot be empty.'));
}
}
But how is it possible to submit an empty password when the password fields are required?:
$form['pass'] = array(
'#type' => 'password_confirm',
'#size' => 25,
'#required' => TRUE,
'#description' => t('To change the current user password, enter the new password in both fields.'),
);
Anyone have any idea? Is the validation code pointless?
Comments
Comment #2
aohrvetpv commented