From 2319a7b74e3fba770835333a3fa53abe299aeacc Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 28 Oct 2024 00:45:50 +0100 Subject: [PATCH] post.php: use unified captcha-response --- post.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/post.php b/post.php index ae1361ce..232a1f8e 100644 --- a/post.php +++ b/post.php @@ -768,25 +768,25 @@ function handle_post() if ($config['dynamic_captcha'] !== false) { if ($_SERVER['REMOTE_ADDR'] === $config['dynamic_captcha']) { if ($config['recaptcha']) { - if (!isset($_POST['g-recaptcha-response'])) { + if (!isset($_POST['captcha-response'])) { error($config['error']['bot']); } - if (!check_recaptcha($config['recaptcha_private'], $_POST['g-recaptcha-response'], null)) { + if (!check_recaptcha($config['recaptcha_private'], $_POST['captcha-response'], null)) { error($config['error']['captcha']); } } elseif ($config['hcaptcha']) { - if (!isset($_POST['h-captcha-response'])) { + if (!isset($_POST['captcha-response'])) { error($config['error']['bot']); } - if (!check_hcaptcha($config['hcaptcha_private'], $_POST['h-captcha-response'], null, $config['hcaptcha_public'])) { + if (!check_hcaptcha($config['hcaptcha_private'], $_POST['captcha-response'], null, $config['hcaptcha_public'])) { error($config['error']['captcha']); } } elseif ($config['turnstile']) { - if (!isset($_POST['cf-turnstile-response'])) { + if (!isset($_POST['captcha-response'])) { error($config['error']['bot']); } $expected_action = $post['op'] ? 'post-thread' : 'post-reply'; - if (!check_turnstile($config['turnstile_private'], $_POST['cf-turnstile-response'], null, $expected_action)) { + if (!check_turnstile($config['turnstile_private'], $_POST['captcha-response'], null, $expected_action)) { error($config['error']['captcha']); } } @@ -794,25 +794,25 @@ function handle_post() } else { // Check for CAPTCHA right after opening the board so the "return" link is in there. if ($config['recaptcha']) { - if (!isset($_POST['g-recaptcha-response'])) { + if (!isset($_POST['captcha-response'])) { error($config['error']['bot']); } - if (!check_recaptcha($config['recaptcha_private'], $_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR'])) { + if (!check_recaptcha($config['recaptcha_private'], $_POST['captcha-response'], $_SERVER['REMOTE_ADDR'])) { error($config['error']['captcha']); } } elseif ($config['hcaptcha']) { - if (!isset($_POST['h-captcha-response'])) { + if (!isset($_POST['captcha-response'])) { error($config['error']['bot']); } - if (!check_hcaptcha($config['hcaptcha_private'], $_POST['h-captcha-response'], $_SERVER['REMOTE_ADDR'], $config['hcaptcha_public'])) { + if (!check_hcaptcha($config['hcaptcha_private'], $_POST['captcha-response'], $_SERVER['REMOTE_ADDR'], $config['hcaptcha_public'])) { error($config['error']['captcha']); } } elseif ($config['turnstile']) { - if (!isset($_POST['cf-turnstile-response'])) { + if (!isset($_POST['captcha-response'])) { error($config['error']['bot']); } $expected_action = $post['op'] ? 'post-thread' : 'post-reply'; - if (!check_turnstile($config['turnstile_private'], $_POST['cf-turnstile-response'], null, $expected_action)) { + if (!check_turnstile($config['turnstile_private'], $_POST['captcha-response'], null, $expected_action)) { error($config['error']['captcha']); } }