1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Merge pull request #691 from vichan-devel/simplespamfix

Simplespamfix
This commit is contained in:
Lorenzo Yario 2024-03-14 06:11:58 -07:00 committed by GitHub
commit 9841102494
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

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

View File

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

View File

@ -217,7 +217,7 @@
</tr>{% endif %}
{% if config.simple_spam and not id %}<tr>
<th>
{{ config.simple_spam.prompt }}
{{ config.simple_spam.question }}
{{ antibot.html() }}
</th>
<td>