diff --git a/inc/config.php b/inc/config.php index af992f0c..2e5e9fd9 100644 --- a/inc/config.php +++ b/inc/config.php @@ -329,7 +329,11 @@ 'answer' => '4' ); */ - // The captcha is dynamically injected on the client if the server replies with the `captcha-required` cookie set to 1. + /** + * The captcha is dynamically injected on the client if the server replies with the `captcha-required` cookie set + * to 1. + * Use false to disable this configuration, otherwise, set the IP that vichan should check for captcha responses. + */ $config['dynamic_captcha'] = false; // Enable reCaptcha to make spam even harder. Rarely necessary. diff --git a/post.php b/post.php index df5e6a72..172f251e 100644 --- a/post.php +++ b/post.php @@ -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']);