Esempio n. 1
0
File: url.php Progetto: cepharum/txf
 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;
 }