1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-19 01:24:05 +01:00

post.php: do not verify the poster IP if the captcha is dynamic

This commit is contained in:
Zankaria 2024-08-15 16:22:58 +02:00
parent cb5fb68c5e
commit f7073d5d7e

View File

@ -661,8 +661,13 @@ if (isset($_POST['delete'])) {
error($config['error']['bot']);
}
$response = $_POST[$field];
/*
* Do not query with the IP if the mode is dynamic. This config is meant for proxies and internal
* loopback addresses.
*/
$ip = $dynamic ? null : $_SERVER['REMOTE_ADDR'];
$success = $query->verify($response, $_SERVER['REMOTE_ADDR']);
$success = $query->verify($response, $ip);
if (!$success) {
error($config['error']['captcha']);
}