Browse Source

Simple anti-spam mechanism

pull/107/head
Your Name 8 months ago
committed by Zankaria
parent
commit
56bbaf881f
  1. 3
      inc/config.php
  2. 6
      post.php

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

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

Loading…
Cancel
Save