summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-04-15 15:13:06 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-04-15 15:13:06 +1000
commit9c7c6320aef9ba53d5613df9714a114f2c2edf12 (patch)
tree00a7faba596365b2d35aa1fa92090423be9a00f2 /inc
parent3d8ab0a350a65183c0772a8603e3c2483db50f17 (diff)
Bugfix: was not correctly purging old anti-bot hashes
Diffstat (limited to 'inc')
-rw-r--r--inc/anti-bot.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/anti-bot.php b/inc/anti-bot.php
index b5fcf2a1..bf73408b 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)