Пример #1
0
 function check($value)
 {
     $pattern = '#^' . '((?<protocol>https?|ftp)://)' . '(?<domain>[-A-Z0-9.]+)' . '(?<file>/[-A-Z0-9+&@\\#/%=~_|!:,.;]*)?' . '(?<parameters>\\?[-A-Z0-9+&@\\#/%=~_|!:,.;]*)?' . '$#i';
     if (!preg_match($pattern, $value, $matches)) {
         return $this->error('{Field} is not an url.');
     }
     parent::check($matches['domain']);
 }
Пример #2
0
 protected function _checkDomain($value)
 {
     parent::check($value);
 }