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