Commit fa5aca1e authored by Dries's avatar Dries

- Fixed error messages not being shown.  Patch by Matt.
parent 8f000195
......@@ -134,6 +134,7 @@ function user_validate_name($name) {
}
function user_validate_mail($mail) {
if (!$mail) return t("You must enter an e-mail address.");
if ($mail && !valid_email_address($mail)) {
return t("The e-mail address '%mail' is not valid.", array("%mail" => $mail));
}
......@@ -228,7 +229,7 @@ function user_mail($mail, $subject, $message, $header) {
$mail,
user_mail_encode($subject),
str_replace("\r", "", $message),
"MIME-Version: 1.0\nContent-type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
"MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
);
}
}
......@@ -778,7 +779,7 @@ function user_register($edit = array()) {
drupal_goto(url("user/edit"));
}
if ($edit["name"] && $edit["mail"]) {
if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}
......@@ -899,7 +900,7 @@ function user_edit($edit = array()) {
global $user;
if ($user->uid) {
if ($edit["name"]) {
if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}
......
......@@ -134,6 +134,7 @@ function user_validate_name($name) {
}
function user_validate_mail($mail) {
if (!$mail) return t("You must enter an e-mail address.");
if ($mail && !valid_email_address($mail)) {
return t("The e-mail address '%mail' is not valid.", array("%mail" => $mail));
}
......@@ -228,7 +229,7 @@ function user_mail($mail, $subject, $message, $header) {
$mail,
user_mail_encode($subject),
str_replace("\r", "", $message),
"MIME-Version: 1.0\nContent-type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
"MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
);
}
}
......@@ -778,7 +779,7 @@ function user_register($edit = array()) {
drupal_goto(url("user/edit"));
}
if ($edit["name"] && $edit["mail"]) {
if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}
......@@ -899,7 +900,7 @@ function user_edit($edit = array()) {
global $user;
if ($user->uid) {
if ($edit["name"]) {
if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment