diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-04-15 15:13:06 +1000 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-05-05 18:07:02 +1000 |
| commit | d76c79cea6232ab1a98be11a684229ab2e586acb (patch) | |
| tree | 9ae98130b92c169a4d8de4be8a7b214f5f4dee1d /inc/anti-bot.php | |
| parent | aeff0a69b100d2cfa5896d043aa1891b993a7a5f (diff) | |
Bugfix: was not correctly purging old anti-bot hashes
Diffstat (limited to 'inc/anti-bot.php')
| -rw-r--r-- | inc/anti-bot.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/anti-bot.php b/inc/anti-bot.php index 9260b237..9e3ffeb2 100644 --- a/inc/anti-bot.php +++ b/inc/anti-bot.php @@ -180,9 +180,9 @@ function _create_antibot($board, $thread) { query('DELETE FROM `antispam` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); if ($thread) - $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread'); + $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread AND `expires` IS NULL'); else - $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` IS NULL'); + $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` IS NULL AND `expires` IS NULL'); $query->bindValue(':board', $board); if ($thread) |
