|
From: Paul S. O. <ps...@us...> - 2002-04-07 15:37:05
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv3753/includes
Modified Files:
Tag: phpBB-2_0_0
functions_validate.php
Log Message:
Fix email address validation compliance + username wildcard problem
Index: functions_validate.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_validate.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** functions_validate.php 2 Apr 2002 21:13:47 -0000 1.6
--- functions_validate.php 7 Apr 2002 15:37:02 -0000 1.6.2.1
***************
*** 64,68 ****
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
--- 64,68 ----
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
***************
*** 77,81 ****
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['word'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
--- 77,81 ----
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
***************
*** 103,107 ****
if ( $email != '' )
{
! if ( preg_match('/^[a-z0-9\.\-_]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email) )
{
$sql = "SELECT ban_email
--- 103,107 ----
if ( $email != '' )
{
! if ( preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email) )
{
$sql = "SELECT ban_email
***************
*** 111,115 ****
while( $row = $db->sql_fetchrow($result) )
{
! $match_email = str_replace('*', '.*', $row['ban_email']);
if ( preg_match('/^' . $match_email . '$/is', $email) )
{
--- 111,115 ----
while( $row = $db->sql_fetchrow($result) )
{
! $match_email = str_replace('*', '.*?', $row['ban_email']);
if ( preg_match('/^' . $match_email . '$/is', $email) )
{
|