00001 <?php 00026 require_once 'Zend/Validate/Abstract.php'; 00027 00039 class Zend_Validate_Sitemap_Lastmod extends Zend_Validate_Abstract 00040 { 00045 const LASTMOD_REGEX = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9]){2}(\\+|-)([0-1][0-9]|2[0-3]):[0-5][0-9])?$/m'; 00046 00051 const NOT_VALID = 'invalidSitemapLastmod'; 00052 00058 protected $_messageTemplates = array( 00059 self::NOT_VALID => "'%value%' is not a valid sitemap lastmod", 00060 ); 00061 00070 public function isValid($value) 00071 { 00072 $this->_setValue($value); 00073 00074 if (!is_string($value)) { 00075 return false; 00076 } 00077 00078 return @preg_match(self::LASTMOD_REGEX, $value) == 1; 00079 } 00080 00081 }