Fix crash if no captcha is enabled

This commit is contained in:
Zankaria authored and Zankaria committed 2024-04-03 14:33:38 +02:00
1 parent 3016d69428
commit 650ef8bcc2
1 file changed
+5 -3
+5 -3
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) {