mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Banning of emails wasn't checked correctly during registration
git-svn-id: file:///svn/phpbb/trunk@5277 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
042aaba879
commit
7c14ced8ca
1 changed files with 31 additions and 3 deletions
|
@ -905,15 +905,43 @@ function validate_email($email)
|
|||
FROM ' . BANLIST_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
// TODO: This is a duplication of code from session->check_ban()
|
||||
$sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end
|
||||
FROM ' . BANLIST_TABLE . '
|
||||
WHERE ban_end >= ' . time() . '
|
||||
OR ban_end = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $email))
|
||||
do
|
||||
{
|
||||
return 'EMAIL_BANNED';
|
||||
if (!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $email))
|
||||
{
|
||||
if (!empty($row['ban_exclude']))
|
||||
{
|
||||
$banned = false;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$banned = true;
|
||||
$ban_row = $row;
|
||||
// Don't break. Check if there is an exclude rule for this user
|
||||
}
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($banned == true)
|
||||
{
|
||||
return 'EMAIL_BANNED';
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$config['allow_emailreuse'])
|
||||
{
|
||||
$sql = 'SELECT user_email_hash
|
||||
|
|
Loading…
Add table
Reference in a new issue