post.php: use the dynamic_captcha config value to pick from which IP to check for captcha reponsens

This commit is contained in:
Zankaria 2024-07-29 20:46:30 +02:00
parent fccd0a16dd
commit 40475158eb
2 changed files with 7 additions and 3 deletions

View file

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