1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-17 11:28:41 +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' '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 ( $config['simple_spam'] = array (
'question' => 'What is 2 + 3?', 'question' => 'What\'s 2+3?',
'answer' => '5' 'answer' => '5'
); );
*/
// Enable reCaptcha to make spam even harder. Rarely necessary. // Enable reCaptcha to make spam even harder. Rarely necessary.
$config['recaptcha'] = false; $config['recaptcha'] = false;

View File

@ -559,7 +559,7 @@ if (isset($_POST['delete'])) {
if (!$dropped_post) { if (!$dropped_post) {
if (isset($config['simple_spam']) && $config['simple_spam'] && $post['op']) { 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']); error($config['error']['simple_spam']);
} }
} }

View File

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