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']); $query = RemoteCaptchaQuery::withHCaptcha($context->getHttpDriver(), $config['hcaptcha_private']);
} }
$success = $query->verify($response, $_SERVER['REMOTE_ADDR']); if (isset($query, $response)) {
if (!$success) { $success = $query->verify($response, $_SERVER['REMOTE_ADDR']);
error($config['error']['captcha']); if (!$success) {
error($config['error']['captcha']);
}
} }
} }
} catch (RuntimeException $e) { } catch (RuntimeException $e) {