mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/7538] Limit user_login_attempts to prevent SQL errors.
PHPBB3-7538
This commit is contained in:
@@ -134,7 +134,8 @@ function login_db(&$username, &$password)
|
||||
// increase login attempt count to make sure this cannot be exploited
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_login_attempts = user_login_attempts + 1
|
||||
WHERE user_id = ' . $row['user_id'];
|
||||
WHERE user_id = ' . (int) $row['user_id'] . '
|
||||
AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
|
||||
$db->sql_query($sql);
|
||||
|
||||
return array(
|
||||
@@ -194,7 +195,8 @@ function login_db(&$username, &$password)
|
||||
// Password incorrect - increase login attempts
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_login_attempts = user_login_attempts + 1
|
||||
WHERE user_id = ' . $row['user_id'];
|
||||
WHERE user_id = ' . (int) $row['user_id'] . '
|
||||
AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Give status about wrong password...
|
||||
|
Reference in New Issue
Block a user