diff --git a/inc/config.php b/inc/config.php index 8c1c5673..7a2f603d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -307,11 +307,15 @@ 'simple_spam' ); - // Enable simple anti-spam measure. + // 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 is 2 + 3?', + 'question' => 'What\'s 2+3?', 'answer' => '5' ); + */ // Enable reCaptcha to make spam even harder. Rarely necessary. $config['recaptcha'] = false; diff --git a/post.php b/post.php index ddfb1f18..86178cde 100644 --- a/post.php +++ b/post.php @@ -559,7 +559,7 @@ if (isset($_POST['delete'])) { if (!$dropped_post) { if (isset($config['simple_spam']) && $config['simple_spam'] && $post['op']) { - if (!isset($_POST['simple_spam']) || $config['simple_spam']['answer'] != $_POST['simple_spam']) { + if (!isset($_POST['simple_spam']) || strtolower($config['simple_spam']['answer']) != strtolower($_POST['simple_spam'])) { error($config['error']['simple_spam']); } } diff --git a/templates/post_form.html b/templates/post_form.html index a1142ea2..b70f2f54 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -217,7 +217,7 @@ {% endif %} {% if config.simple_spam and not id %}