protected function validator($varInput)
{
$this->blnSubmitInput = false;
if (!strlen($varInput) && (strlen($this->varValue) || !$this->mandatory)) {
return '';
}
if (Utf8::strlen($varInput) < \Config::get('minPasswordLength')) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['passwordLength'], \Config::get('minPasswordLength')));
}
if ($varInput != $this->getPost($this->strName . '_confirm')) {
$this->addError($GLOBALS['TL_LANG']['ERR']['passwordMatch']);
}
$varInput = parent::validator($varInput);
if (!$this->hasErrors()) {
$this->blnSubmitInput = true;
return \Encryption::hash($varInput);
}
return '';
}