mirror of
https://github.com/openvk/commitcaptcha.git
synced 2024-12-22 16:41:09 +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;
|
return $image;
|
||||||
}
|
}
|
||||||
|
|
||||||
function verifyCaptcha(string $input): bool
|
function verifyCaptcha(?string $input = NULL): bool
|
||||||
{
|
{
|
||||||
if(!COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"])
|
if(!COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"])
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if(!$input)
|
||||||
|
$input = $_POST["captcha"];
|
||||||
|
|
||||||
$data = $this->session->get("captcha");
|
$data = $this->session->get("captcha");
|
||||||
if(!$data)
|
if(!$data)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue