- Make sure the form has been submitted before validating and saving user.

4.5.x
Kjartan Mannes 2004-05-31 17:27:12 +00:00
parent b08aba8fa2
commit fd4d894340
2 changed files with 76 additions and 76 deletions

View File

@ -874,7 +874,7 @@ function user_register($edit = array()) {
drupal_goto('user/edit');
}
if (!(is_null($edit['name']) && is_null($edit['mail']))) {
if ($edit) {
if ($error = user_validate_name($edit['name'])) {
form_set_error('name', $error);
}
@ -903,7 +903,6 @@ function user_register($edit = array()) {
}
}
}
}
if (!form_has_errors()) {
$from = variable_get('site_mail', ini_get('sendmail_from'));
@ -946,6 +945,7 @@ function user_register($edit = array()) {
}
}
}
}
// Display the registration form.
$output .= variable_get('user_registration_help', '');

View File

@ -874,7 +874,7 @@ function user_register($edit = array()) {
drupal_goto('user/edit');
}
if (!(is_null($edit['name']) && is_null($edit['mail']))) {
if ($edit) {
if ($error = user_validate_name($edit['name'])) {
form_set_error('name', $error);
}
@ -903,7 +903,6 @@ function user_register($edit = array()) {
}
}
}
}
if (!form_has_errors()) {
$from = variable_get('site_mail', ini_get('sendmail_from'));
@ -946,6 +945,7 @@ function user_register($edit = array()) {
}
}
}
}
// Display the registration form.
$output .= variable_get('user_registration_help', '');