diff --git a/inc/config.php b/inc/config.php index a64f9ad8..05e90f1d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -313,11 +313,12 @@ ); // Enable simple anti-spam measure. + /* $config['simple_spam'] = array ( 'prompt' => 'What is 2 + 2?', 'answer' => '4' ); - + */ // Enable reCaptcha to make spam even harder. Rarely necessary. $config['recaptcha'] = false; diff --git a/post.php b/post.php index 4a46d4d0..b092a20e 100644 --- a/post.php +++ b/post.php @@ -483,9 +483,9 @@ function handle_post(){ } } - if ($config['simple_spam'] && $post['op']) { - if(!isset($_POST['simple_spam']) || $config['simple_spam']['answer'] != $_POST['simple_spam'])){ - $config['error']['spam']; + if (isset($config['simple_spam']) && $post['op']) { + if(!isset($_POST['simple_spam']) || $config['simple_spam']['answer'] != $_POST['simple_spam']){ + error($config['error']['spam']); } }