diff --git a/inc/anti-bot.php b/inc/anti-bot.php index 59f5351f..74f377c2 100644 --- a/inc/anti-bot.php +++ b/inc/anti-bot.php @@ -197,7 +197,7 @@ function _create_antibot($board, $thread) { if (!isset($purged_old_antispam)) { $purged_old_antispam = true; - query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); + //query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); } if ($thread) @@ -276,6 +276,8 @@ function checkSpam(array $extra_salt = array()) { } function incrementSpamHash($hash) { + if ($hash === true) return; + $query = prepare('UPDATE ``antispam`` SET `passed` = `passed` + 1 WHERE `hash` = :hash'); $query->bindValue(':hash', $hash); $query->execute() or error(db_error($query)); diff --git a/inc/config.php b/inc/config.php index ce6f31bd..1531d807 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1089,7 +1089,7 @@ $config['error']['image_hard_limit'] = _('Thread has reached its maximum image limit.'); $config['error']['nopost'] = _('You didn\'t make a post.'); $config['error']['flood'] = _('Flood detected; Post discarded.'); - $config['error']['spam'] = _('Your request looks automated; Post discarded.'); + $config['error']['spam'] = _('Your request looks automated; Post discarded. Try refreshing the page.'); $config['error']['unoriginal'] = _('Unoriginal content!'); $config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.'); $config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.'); diff --git a/inc/instance-config.php b/inc/instance-config.php index 41407f0b..44d38f33 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -203,6 +203,8 @@ $config['mask_db_error'] = true; $config['ban_appeals'] = true; $config['show_sages'] = false; $config['katex'] = false; +$config['enable_antibot'] = true; +$config['spam']['unicode'] = false; // 8chan specific mod pages require '8chan-mod-pages.php'; diff --git a/post.php b/post.php index f1e75b33..b303f536 100644 --- a/post.php +++ b/post.php @@ -283,11 +283,11 @@ elseif (isset($_POST['post'])) { error($config['error']['noaccess']); } - /*if (!$post['mod']) { + if (!$post['mod']) { $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); - if ($post['antispam_hash'] === true) + if ($post['antispam_hash'] === true && $config['enable_antibot']) error($config['error']['spam']); - }*/ + } if ($config['robot_enable'] && $config['robot_mute']) { checkMute();