Fixed broken flood control (#666)

This commit is contained in:
Roman Kelesidis 2023-03-29 00:32:44 +07:00 committed by GitHub
commit f62d25d33b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -234,7 +234,7 @@ switch ($this->request['type']) {
$sql = "SELECT MAX(p.post_time) AS last_post_time FROM " . BB_POSTS . " p WHERE $where_sql";
if ($row = DB()->fetch_row($sql) and $row['last_post_time']) {
if ($userdata['user_level'] == USER) {
if (TIMENOW - $row['last_post_time'] < $bb_cfg['flood_interval']) {
if ((TIMENOW - $row['last_post_time']) < $bb_cfg['flood_interval']) {
$this->ajax_die($lang['FLOOD_ERROR']);
}
}

View file

@ -105,10 +105,9 @@ class Post
if ($mode == 'newtopic' || $mode == 'reply') {
$sql = "SELECT MAX(p.post_time) AS last_post_time FROM " . BB_POSTS . " p WHERE $where_sql";
if ($row = DB()->fetch_row($sql) && $row['last_post_time']) {
if ($row = DB()->fetch_row($sql) and $row['last_post_time']) {
if ($userdata['user_level'] == USER) {
if (TIMENOW - $row['last_post_time'] < $bb_cfg['flood_interval']) {
if ((TIMENOW - $row['last_post_time']) < $bb_cfg['flood_interval']) {
bb_die($lang['FLOOD_ERROR']);
}
}