Refactor check_captcha(...)

This commit is contained in:
rem-pai 2021-01-11 20:27:59 +02:00 committed by GitHub
parent 8bb31718d1
commit 444fe447c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,8 +14,11 @@ HTML;
return COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"] ? $html : "You have already verified that you are not a robot.";
}
function check_captcha(?string $input): bool
function check_captcha(?string $input = NULL): bool
{
if(!$input)
$input = $_POST["captcha"] ?? 0;
return CaptchaManager::i()->verifyCaptcha((string) $input);
}