diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php index a50e1343f6..4810a9587e 100644 --- a/phpBB/phpbb/auth/provider/db.php +++ b/phpBB/phpbb/auth/provider/db.php @@ -153,8 +153,12 @@ class db extends base } $login_error_attempts = 'LOGIN_ERROR_ATTEMPTS'; - $show_captcha = ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) || - ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']); + + $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']); + + $show_captcha = $user_login_attempts || $ip_login_attempts; + if ($show_captcha) { $captcha = $this->captcha_factory->get_instance($this->config['captcha_plugin']);