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

Fix crash if no captcha is enabled

This commit is contained in:
Zankaria 2024-04-01 19:36:37 +02:00 committed by Zankaria
parent 3016d69428
commit 650ef8bcc2

View File

@ -627,9 +627,11 @@ if (isset($_POST['delete'])) {
$query = RemoteCaptchaQuery::withHCaptcha($context->getHttpDriver(), $config['hcaptcha_private']);
}
$success = $query->verify($response, $_SERVER['REMOTE_ADDR']);
if (!$success) {
error($config['error']['captcha']);
if (isset($query, $response)) {
$success = $query->verify($response, $_SERVER['REMOTE_ADDR']);
if (!$success) {
error($config['error']['captcha']);
}
}
}
} catch (RuntimeException $e) {