- Patch #11791 by kps: trim passwords to avoid copy-paste mistakes.

4.6.x
Dries Buytaert 2005-05-21 11:59:29 +00:00
parent 716539c277
commit c3620684e8
1 changed files with 3 additions and 1 deletions

View File

@ -802,7 +802,7 @@ function user_login($edit = array(), $msg = '') {
else if ($edit['name'] && $edit['pass']) {
if (!$user->uid) {
$user = user_authenticate($edit['name'], $edit['pass']);
$user = user_authenticate($edit['name'], trim($edit['pass']));
}
if ($user->uid) {
@ -1115,6 +1115,8 @@ function user_edit_validate($uid, &$edit) {
// If required, check that proposed passwords match. If so, add the new password to $edit.
if ($edit['pass1']) {
$edit['pass1'] = trim($edit['pass1']);
$edit['pass2'] = trim($edit['pass2']);
if ($edit['pass1'] == $edit['pass2']) {
$edit['pass'] = $edit['pass1'];
}