mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
fix antispam quick-reply index
This commit is contained in:
parent
60e2ca2a88
commit
4b20ad55ff
@ -318,6 +318,7 @@
|
||||
'hash',
|
||||
'board',
|
||||
'thread',
|
||||
'active-page',
|
||||
'mod',
|
||||
'name',
|
||||
'email',
|
||||
|
10
post.php
10
post.php
@ -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']);
|
||||
}
|
||||
|
@ -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() }}
|
||||
|
Loading…
Reference in New Issue
Block a user