1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-22 19:32:04 +01:00

fix captcha being triggered when only new_thread_capt is enabled

This commit is contained in:
fowr 2025-01-09 14:51:37 -03:00
parent 1212c18616
commit 8ccf506e0f

View File

@ -632,22 +632,22 @@ if (isset($_POST['delete'])) {
$dynamic = $config['captcha']['dynamic'];
// With our custom captcha provider
if (($provider === 'native' && !$new_thread_capt)
|| ($provider === 'native' && $new_thread_capt && $post['op'])) {
$query = $context->get(SecureImageCaptchaQuery::class);
$success = $query->verify($_POST['captcha_text'], $_POST['captcha_cookie']);
if ($provider === 'native') {
if ((!$new_thread_capt && !$post['op']) || ($new_thread_capt && $post['op'])) {
$query = $context->get(SecureImageCaptchaQuery::class);
$success = $query->verify($_POST['captcha_text'], $_POST['captcha_cookie']);
if (!$success) {
error(
"{$config['error']['captcha']}
<script>
if (actually_load_captcha !== undefined)
actually_load_captcha(
\"{$config['captcha']['provider_get']}\",
\"{$config['captcha']['extra']}\"
);
</script>"
);
if (!$success) {
error(
"{$config['error']['captcha']}
<script>
if (actually_load_captcha !== undefined)
actually_load_captcha(
\"{$config['captcha']['provider_get']}\"
);
</script>"
);
}
}
}
// Remote 3rd party captchas.