Пример #1
0
 /**
  * Validates if a string is valid as a sitemap location
  *
  * @link http://www.sitemaps.org/protocol.php#locdef <loc>
  *
  * @param  string  $value  value to validate
  * @return boolean
  */
 public function isValid($value)
 {
     if (!is_string($value)) {
         $this->_error(self::INVALID);
         return false;
     }
     $this->_setValue($value);
     $uri = new \Zend\Uri\Url($value);
     $uri->setAllowUnwise(false);
     if (!$uri->isValid()) {
         $this->_error(self::NOT_VALID);
         return false;
     }
     return true;
 }