mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-16 15:08:54 +00:00
[ticket/16007] No strict comparison against "false"
PHPBB3-16007
This commit is contained in:
parent
68434e6dbc
commit
fc62538733
3 changed files with 7 additions and 4 deletions
|
@ -1932,7 +1932,7 @@ function validate_user_email($email, $allowed_email = false)
|
||||||
|
|
||||||
if (($ban = $user->check_ban(false, false, $email, true)) !== false)
|
if (($ban = $user->check_ban(false, false, $email, true)) !== false)
|
||||||
{
|
{
|
||||||
return !empty($ban['ban_give_reason']) ? $ban['ban_give_reason'] : 'EMAIL_BANNED';
|
return ($ban === true) ? 'EMAIL_BANNED' : (!empty($ban['ban_give_reason']) ? $ban['ban_give_reason'] : $ban);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$config['allow_emailreuse'])
|
if (!$config['allow_emailreuse'])
|
||||||
|
|
|
@ -278,7 +278,7 @@ class oauth extends \phpbb\auth\provider\base
|
||||||
* token stored in the database.
|
* token stored in the database.
|
||||||
*/
|
*/
|
||||||
$ban = $this->user->check_ban($row['user_id'], $row['user_ip'], $row['user_email'], true);
|
$ban = $this->user->check_ban($row['user_id'], $row['user_ip'], $row['user_email'], true);
|
||||||
if ($ban !== false)
|
if (!empty($ban))
|
||||||
{
|
{
|
||||||
$till_date = !empty($ban['ban_end']) ? $this->user->format_date($ban['ban_end']) : '';
|
$till_date = !empty($ban['ban_end']) ? $this->user->format_date($ban['ban_end']) : '';
|
||||||
$message = !empty($ban['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
$message = !empty($ban['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
||||||
|
|
|
@ -1234,8 +1234,6 @@ class session
|
||||||
$vars = array('return', 'banned', 'ban_row', 'ban_triggered_by');
|
$vars = array('return', 'banned', 'ban_row', 'ban_triggered_by');
|
||||||
extract($phpbb_dispatcher->trigger_event('core.session_set_custom_ban', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.session_set_custom_ban', compact($vars)));
|
||||||
|
|
||||||
$ban_row['ban_triggered_by'] = $ban_triggered_by;
|
|
||||||
|
|
||||||
if ($banned && !$return)
|
if ($banned && !$return)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
@ -1301,6 +1299,11 @@ class session
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($ban_row))
|
||||||
|
{
|
||||||
|
$ban_row['ban_triggered_by'] = $ban_triggered_by;
|
||||||
|
}
|
||||||
|
|
||||||
return ($banned && $ban_row) ? $ban_row : $banned;
|
return ($banned && $ban_row) ? $ban_row : $banned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue