From 5828612677cfc62f176d8e32b3027bfc70e76a65 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 18 May 2008 20:00:46 +0000 Subject: #26885 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8563 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 1d774a8ff4..0ed93d4376 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1194,6 +1194,8 @@ function user_ipwhois($ip) */ function validate_data($data, $val_ary) { + global $user; + $error = array(); foreach ($val_ary as $var => $val_seq) @@ -1210,7 +1212,8 @@ function validate_data($data, $val_ary) if ($result = call_user_func_array('validate_' . $function, $validate)) { - $error[] = $result . '_' . strtoupper($var); + // Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted. + $error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var); } } } @@ -1610,9 +1613,9 @@ function validate_email($email, $allowed_email = false) } } - if ($user->check_ban(false, false, $email, true) == true) + if (($ban_reason = $user->check_ban(false, false, $email, true)) !== false) { - return 'EMAIL_BANNED'; + return ($ban_reason === true) ? 'EMAIL_BANNED' : $ban_reason; } if (!$config['allow_emailreuse']) -- cgit v1.2.1