From 650ef8bcc28f7d364fc55f30ea19c6985d54fe30 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 1 Apr 2024 19:36:37 +0200 Subject: [PATCH] Fix crash if no captcha is enabled --- post.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/post.php b/post.php index d43f37a5..954b2ed5 100644 --- a/post.php +++ b/post.php @@ -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) {