Skip to content
Snippets Groups Projects
Commit ef14b0df authored by Angie Byron's avatar Angie Byron
Browse files

#61856 by blakehall, Pancho, and jredding: Trim e-mail addresses before validation/submission.

parent 45731a4e
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -521,6 +521,7 @@ function user_save($account, $edit = array(), $category = 'account') {
$edit['access'] = REQUEST_TIME;
}
$edit['mail'] = trim($edit['mail']);
$success = drupal_write_record('users', $edit);
if (!$success) {
// On a failed INSERT some other existing user's uid may be returned.
......@@ -613,6 +614,7 @@ function user_validate_name($name) {
}
function user_validate_mail($mail) {
$mail = trim($mail);
if (!$mail) {
return t('You must enter an e-mail address.');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment