mirror of
https://github.com/openvk/commitcaptcha.git
synced 2024-12-22 08:30:57 +03:00
Refactor captcha check function
This commit is contained in:
parent
ea6f1f8dfc
commit
8bb31718d1
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue