protected function validator($varInput)
{
if (is_array($varInput)) {
return parent::validator($varInput);
}
if (!$this->multiple) {
// Convert to Punycode format (see #5571)
if ($this->rgxp == 'url') {
$varInput = \Idna::encodeUrl($varInput);
} elseif ($this->rgxp == 'email' || $this->rgxp == 'friendly') {
$varInput = \Idna::encodeEmail($varInput);
}
}
return parent::validator($varInput);
}
/** * @param mixed $varInput * @return mixed */ protected function validator($varInput) { $this->rgxp = 'digit'; $varInput = $this->encode($varInput); if ($this->unsigned && $varInput < 0) { $varInput = $varInput * -1; } return parent::validator(trim($varInput)); }