From 8bb31718d1f81bb9f83c4053633bdb557f51499c Mon Sep 17 00:00:00 2001 From: Alma Armas Date: Thu, 31 Dec 2020 21:21:55 +0000 Subject: [PATCH] Refactor captcha check function --- CaptchaManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CaptchaManager.php b/CaptchaManager.php index c4a1ca9..779ed11 100644 --- a/CaptchaManager.php +++ b/CaptchaManager.php @@ -94,11 +94,14 @@ class CaptchaManager return $image; } - function verifyCaptcha(string $input): bool + function verifyCaptcha(?string $input = NULL): bool { if(!COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"]) return true; + if(!$input) + $input = $_POST["captcha"]; + $data = $this->session->get("captcha"); if(!$data) return false;