Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
2a744f89
Commit
2a744f89
authored
May 21, 2005
by
Dries Buytaert
Browse files
- Patch
#11791
by kps: trim passwords to avoid copy-paste mistakes.
parent
fafa11af
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/user.module
View file @
2a744f89
...
...
@@ -805,7 +805,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
)
{
...
...
@@ -1158,6 +1158,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'
];
}
...
...
modules/user/user.module
View file @
2a744f89
...
...
@@ -805,7 +805,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
)
{
...
...
@@ -1158,6 +1158,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'
];
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment