public function validate($input, $property, model_editor $editor) { parent::validate($input, $property, $editor); if ($input != '') { if (!mail::isValidAddress($input)) { throw new \InvalidArgumentException(\de\toxa\txf\_L('This is not a valid e-mail address.')); } } return true; }
public function validate($input, $property, model_editor $editor) { parent::validate($input, $property, $editor); if ($input != '') { if (!url::isFile($input)) { throw new \InvalidArgumentException(\de\toxa\txf\_L('This is not a valid URL.')); } if ($this->absolute && url::isRelative($input)) { throw new \InvalidArgumentException(\de\toxa\txf\_L('This URL must be absolute. Include scheme e.g. http://www.example.com/!')); } } return true; }