1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

fix antispam quick-reply index

This commit is contained in:
fowr 2024-08-29 13:14:46 -03:00
parent 60e2ca2a88
commit 4b20ad55ff
No known key found for this signature in database
GPG Key ID: 41DE01A5187B8438
3 changed files with 16 additions and 2 deletions

View File

@ -318,6 +318,7 @@
'hash',
'board',
'thread',
'active-page',
'mod',
'name',
'email',

View File

@ -713,7 +713,15 @@ if (isset($_POST['delete'])) {
}
if (!$post['mod']) {
$post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null)));
if (isset($_POST['active-page']) && $_POST['active-page'] === 'index') {
$page = isset($_POST['page']) ? (int)$_POST['page'] : 0;
$extra_salt = $config['try_smarter'] ? -$page : 0;
} else {
$extra_salt = $post['thread'];
}
$post['antispam_hash'] = checkSpam(array($board['uri'], $extra_salt));
if ($post['antispam_hash'] === true)
error($config['error']['spam']);
}

View File

@ -1,6 +1,11 @@
<form name="post" onsubmit="return doPost(this);" enctype="multipart/form-data" action="{{ config.post_url }}" method="post">
{{ antibot.html() }}
{% if id %}<input type="hidden" name="thread" value="{{ id }}">{% endif %}
{% if id %}
<input type="hidden" name="thread" value="{{ id }}">
<input type="hidden" name="active-page" value="thread">
{% else %}
<input type="hidden" name="active-page" value="index">
{% endif %}
{{ antibot.html() }}
<input type="hidden" name="board" value="{{ board.uri }}">
{{ antibot.html() }}