|
From: Paul S. O. <ps...@us...> - 2002-02-12 17:14:04
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv13688
Modified Files:
profile.php
Log Message:
Change way error is returned to validate email/username, fixes problem with lack of language support for error output and subsequent doubled username, etc. issues
Index: profile.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/profile.php,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -r1.176 -r1.177
*** profile.php 28 Jan 2002 12:37:41 -0000 1.176
--- profile.php 12 Feb 2002 17:14:01 -0000 1.177
***************
*** 93,99 ****
global $db, $lang;
! if($email != "")
{
! if( preg_match("/^[a-z0-9\.\-_]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is", $email) )
{
$sql = "SELECT ban_email
--- 93,99 ----
global $db, $lang;
! if ( $email != "" )
{
! if ( preg_match("/^[a-z0-9\.\-_]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is", $email) )
{
$sql = "SELECT ban_email
***************
*** 106,110 ****
if ( preg_match("/^" . $match_email . "$/is", $email) )
{
! return array('error' => $lang['Email_banned']);
}
}
--- 106,110 ----
if ( preg_match("/^" . $match_email . "$/is", $email) )
{
! return array('error' => true, 'error_msg' => $lang['Email_banned']);
}
}
***************
*** 121,132 ****
if ( $email_taken = $db->sql_fetchrow($result) )
{
! return array('error' => $lang['Email_taken']);
}
! return array('error' => '');
}
}
! return array('error' => $lang['Email_invalid']);
}
--- 121,132 ----
if ( $email_taken = $db->sql_fetchrow($result) )
{
! return array('error' => true, 'error_msg' => $lang['Email_taken']);
}
! return array('error' => false, 'error_msg' => '');
}
}
! return array('error' => true, 'error_msg' => $lang['Email_invalid']);
}
***************
*** 235,244 ****
if ( $mode == "viewprofile" )
{
-
if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
! $profiledata = get_userdata_from_id(intval($HTTP_GET_VARS[POST_USERS_URL]));
$sql = "SELECT *
--- 235,243 ----
if ( $mode == "viewprofile" )
{
if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
! $profiledata = get_userdata(intval($HTTP_GET_VARS[POST_USERS_URL]));
$sql = "SELECT *
***************
*** 671,675 ****
{
$result = validate_email($email);
! if( $result['error'] != '' )
{
$email = $userdata['user_email'];
--- 670,674 ----
{
$result = validate_email($email);
! if( $result['error'] )
{
$email = $userdata['user_email'];
***************
*** 680,684 ****
$error_msg .= "<br />";
}
! $error_msg .= $result['error'];
}
--- 679,683 ----
$error_msg .= "<br />";
}
! $error_msg .= $result['error_msg'];
}
***************
*** 713,717 ****
{
$result = validate_username($username);
! if( $result['error'] != '' )
{
$error = TRUE;
--- 712,716 ----
{
$result = validate_username($username);
! if( $result['error'] )
{
$error = TRUE;
***************
*** 720,724 ****
$error_msg .= "<br />";
}
! $error_msg .= $result['error'];
}
else
--- 719,723 ----
$error_msg .= "<br />";
}
! $error_msg .= $result['error_msg'];
}
else
|