[ticket/16735] Fix access array offset on value of type bool on login

properly check if is an array first

PHPBB3-16735
This commit is contained in:
3D-I 2021-03-23 23:57:43 +01:00
parent 736b619294
commit c4efe5d0fa

View file

@ -154,7 +154,7 @@ class db extends base
$login_error_attempts = 'LOGIN_ERROR_ATTEMPTS'; $login_error_attempts = 'LOGIN_ERROR_ATTEMPTS';
$user_login_attempts = $row ? ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) : false; $user_login_attempts = (is_array($row) && $this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']);
$ip_login_attempts = ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']); $ip_login_attempts = ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']);
$show_captcha = $user_login_attempts || $ip_login_attempts; $show_captcha = $user_login_attempts || $ip_login_attempts;