fix (Captcha) allow null value for bypassCode
This commit is contained in:
parent
5515c25872
commit
61a8561dd6
|
@ -49,20 +49,12 @@ class CaptchaValidator
|
||||||
*/
|
*/
|
||||||
private $translator;
|
private $translator;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param TranslatorInterface $translator
|
|
||||||
* @param SessionInterface $session
|
|
||||||
* @param string $key
|
|
||||||
* @param string $invalidMessage
|
|
||||||
* @param string $bypassCode
|
|
||||||
* @param int $humanity
|
|
||||||
*/
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
SessionInterface $session,
|
SessionInterface $session,
|
||||||
string $key,
|
string $key,
|
||||||
string $invalidMessage,
|
string $invalidMessage,
|
||||||
string $bypassCode,
|
?string $bypassCode,
|
||||||
int $humanity
|
int $humanity
|
||||||
) {
|
) {
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
|
@ -146,9 +138,8 @@ class CaptchaValidator
|
||||||
/**
|
/**
|
||||||
* Run a match comparison on the provided code and the expected code
|
* Run a match comparison on the provided code and the expected code
|
||||||
*
|
*
|
||||||
* @param $code
|
* @param string $code
|
||||||
* @param $expectedCode
|
* @param string|null $expectedCode
|
||||||
*
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function compare($code, $expectedCode): bool
|
protected function compare($code, $expectedCode): bool
|
||||||
|
|
Loading…
Reference in New Issue