post.php: make dynamic captcha less prone to misuse

This commit is contained in:
Zankaria 2024-07-29 20:48:22 +02:00
parent 40475158eb
commit 8f98665a1c

View file

@ -727,7 +727,8 @@ function handle_post()
if (!$dropped_post) {
if ($config['dynamic_captcha'] !== false && $_SERVER['REMOTE_ADDR'] === $config['dynamic_captcha']) {
if ($config['dynamic_captcha'] !== false) {
if ($_SERVER['REMOTE_ADDR'] === $config['dynamic_captcha']) {
if ($config['recaptcha']) {
if (!isset($_POST['g-recaptcha-response'])) {
error($config['error']['bot']);
@ -745,9 +746,8 @@ function handle_post()
}
}
}
} else {
// Check for CAPTCHA right after opening the board so the "return" link is in there.
if ($config['dynamic_captcha'] === false) {
if ($config['recaptcha']) {
if (!isset($_POST['g-recaptcha-response'])) {
error($config['error']['bot']);