ZF-10090: Zend_Locale_Format::checkDateFormat() incorrect handles dates with zero parts

Description

Zend_Locale_Format::checkDateFormat() incorrect handles dates with zero parts.

h3. Steps to reproduce

$filter = new Zend_Filter_LocalizedToNormalized(array('date_format' => 'M/d/yy h:mm a'));
var_dump($filter->filter('06/23/10 12:00 AM'));

returns:


but should return array:

array(7) { ["date_format"]=> string(13) "M/d/yy h:mm a" ["locale"]=> string(2) "en" ["month"]=> string(2) "06" ["day"]=> string(2) "23" ["year"]=> int(2010) ["hour"]=> int(0) ["minute"]=> string(2) "00" }````

h3. Cause of Issue

Zend_Locale_Format on line 1160 has such comparison: {{$date['hour'] == "",}} but {{(int)0 == (string)"".}}

h3. Suggested solution

Cast to string before comparison.

Comments

It's patch for trunk.

Patch not accepted. It breaks functionality and fails several unittests.

Fixed with r22552