From d5109426d970bb8ae6bb6d6c9abb9cc1b13fe3a8 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 14 Mar 2024 14:40:55 +0100 Subject: [PATCH] Prettier simple-antispam --- inc/config.php | 16 +++++++--------- post.php | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/inc/config.php b/inc/config.php index 7a2f603d..614c0f4d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -308,14 +308,12 @@ ); // Enable simple anti-spam measure. Requires the end-user to answer a question before making a post. - //Works very well against uncustomized spam. - //Answers are case-insensitive. - /* - $config['simple_spam'] = array ( - 'question' => 'What\'s 2+3?', - 'answer' => '5' - ); - */ + // Works very well against uncustomized spam. Answers are case-insensitive. + // $config['simple_spam'] = array ( + // 'question' => 'What\'s 2+3?', + // 'answer' => '5' + //); + $config['simple_spam'] = false; // Enable reCaptcha to make spam even harder. Rarely necessary. $config['recaptcha'] = false; @@ -1169,7 +1167,7 @@ $config['error']['flood'] = _('Flood detected; Post discarded.'); $config['error']['too_many_threads'] = _('The hourly thread limit has been reached. Please post in an existing thread.'); $config['error']['spam'] = _('Your request looks automated; Post discarded.'); - $config['error']['simple_spam'] = _('You must answer the question to make a new thread. See the last field.'); + $config['error']['simple_spam'] = _('You must answer the question to make a new thread. See the last field.'); $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/post.php b/post.php index 86178cde..3f4951d9 100644 --- a/post.php +++ b/post.php @@ -558,7 +558,7 @@ if (isset($_POST['delete'])) { if (!$dropped_post) { - if (isset($config['simple_spam']) && $config['simple_spam'] && $post['op']) { + if ($config['simple_spam'] && $post['op']) { if (!isset($_POST['simple_spam']) || strtolower($config['simple_spam']['answer']) != strtolower($_POST['simple_spam'])) { error($config['error']['simple_spam']); }