Prado\Web\UI\WebControls\TCaptcha::validate PHP Méthode

validate() public méthode

Validates a user input with the token.
public validate ( $input ) : boolean
Résultat boolean if the user input is not the same as the token.
    public function validate($input)
    {
        $number = $this->getViewState('TestNumber', 0);
        if (!$this->_validated) {
            $this->setViewState('TestNumber', ++$number);
            $this->_validated = true;
        }
        if ($this->getIsTokenExpired() || ($limit = $this->getTestLimit()) > 0 && $number > $limit) {
            $this->regenerateToken();
            return false;
        }
        return $this->getToken() === ($this->getCaseSensitive() ? $input : strtoupper($input));
    }