From ad220b725d6411657d62f081885891d394baaf4d Mon Sep 17 00:00:00 2001 From: Michael Save Date: Mon, 7 May 2012 23:51:15 +1000 Subject: Bugfix: the number of successful passes for an anti-spam "hash" was often incorrectly incremented --- post.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'post.php') diff --git a/post.php b/post.php index b4a256a5..aa4d915b 100644 --- a/post.php +++ b/post.php @@ -212,8 +212,11 @@ if (isset($_POST['delete'])) { error($config['error']['noaccess']); } - if (!$post['mod'] && checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : null))) - error($config['error']['spam']); + if (!$post['mod']) { + $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : null)); + if ($post['antispam_hash'] === true) + error($config['error']['spam']); + } if ($config['robot_enable'] && $config['robot_mute']) { checkMute(); @@ -526,6 +529,10 @@ if (isset($_POST['delete'])) { $id = post($post); + if (isset($post['antispam_hash'])) { + incrementSpamHash($post['antispam_hash']); + } + if (isset($post['tracked_cites'])) { foreach ($post['tracked_cites'] as $cite) { $query = prepare('INSERT INTO `cites` VALUES (:board, :post, :target_board, :target)'); -- cgit v1.3