Simple anti-spam mechanism

This commit is contained in:
Your Name 2023-09-11 01:17:39 +02:00 committed by Zankaria
parent b833e2743a
commit 56bbaf881f
2 changed files with 5 additions and 4 deletions

View file

@ -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;

View file

@ -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']);
}
}