protected function validator($varInput)
{
$this->import('BackendUser', 'User');
$varInput[0] = parent::validator($varInput[0]);
$varInput[1] = parent::validator($varInput[1]);
$varInput[2] = preg_replace('/[^a-z0-9_]+/', '', $varInput[2]);
$imageSizes = \System::getContainer()->get('contao.image.image_sizes');
$this->arrAvailableOptions = $this->User->isAdmin ? $imageSizes->getAllOptions() : $imageSizes->getOptionsForUser($this->User);
if (!$this->isValidOption($varInput[2])) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], $varInput[2]));
}
return $varInput;
}