forked from leftypol/leftypol
Simple anti-spam mechanism
This commit is contained in:
parent
b833e2743a
commit
56bbaf881f
2 changed files with 5 additions and 4 deletions
|
@ -313,11 +313,12 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
// Enable simple anti-spam measure.
|
// Enable simple anti-spam measure.
|
||||||
|
/*
|
||||||
$config['simple_spam'] = array (
|
$config['simple_spam'] = array (
|
||||||
'prompt' => 'What is 2 + 2?',
|
'prompt' => 'What is 2 + 2?',
|
||||||
'answer' => '4'
|
'answer' => '4'
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
// Enable reCaptcha to make spam even harder. Rarely necessary.
|
// Enable reCaptcha to make spam even harder. Rarely necessary.
|
||||||
$config['recaptcha'] = false;
|
$config['recaptcha'] = false;
|
||||||
|
|
||||||
|
|
6
post.php
6
post.php
|
@ -483,9 +483,9 @@ function handle_post(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['simple_spam'] && $post['op']) {
|
if (isset($config['simple_spam']) && $post['op']) {
|
||||||
if(!isset($_POST['simple_spam']) || $config['simple_spam']['answer'] != $_POST['simple_spam'])){
|
if(!isset($_POST['simple_spam']) || $config['simple_spam']['answer'] != $_POST['simple_spam']){
|
||||||
$config['error']['spam'];
|
error($config['error']['spam']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue