ZF-6374: Zend_Validate_Date don't make use of the application-wide locale
Description
Application - Wide Locale is ignored within the Zend_Validate_Date class.
The first IF - condition is the problem. It uses only Zend_Date::isValid (which use the application wide locale if no locale is set as parameter) if a locale is in the Validation object set. Otherwise it uses hard coded validation rules which make absolutely no sense in multilanguage applications.
if (($this->_format !== null) or ($this->_locale !== null)) {
require_once 'Zend/Date.php';
if (!Zend_Date::isDate($value, $this->_format, $this->_locale)) {
if ($this->_checkFormat($value) === false) {
$this->_error(self::FALSEFORMAT);
} else {
$this->_error(self::INVALID);
}
return false;
}
...
don't make use of the application-wide locale
Comments
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-04-22T06:55:20.000+0000
Reassigned.
Posted by Thomas Weidner (thomas) on 2009-06-28T12:26:37.000+0000
Under code review since 28.06.2009 (r16343)
Posted by Thomas Weidner (thomas) on 2009-06-30T12:42:13.000+0000
New feature implemented with r16377