Zend Framework

Zend_Validate_Date don't make use of the application-wide locale

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.8
  • Fix Version/s: 1.9.0
  • Component/s: Zend_Validate
  • Labels:
    None

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

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

Reassigned.

Show
Dolf Schimmel (Freeaqingme) added a comment - Reassigned.
Hide
Thomas Weidner added a comment -

Under code review since 28.06.2009 (r16343)

Show
Thomas Weidner added a comment - Under code review since 28.06.2009 (r16343)
Hide
Thomas Weidner added a comment -

New feature implemented with r16377

Show
Thomas Weidner added a comment - New feature implemented with r16377

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: