ZF-6532: Zend_Filter_LocalizedToNormalized return date array instead of integer
Description
$filter = new Zend_Filter_LocalizedToNormalized(array('locale' => 'de','precision' => 0)); $val = $filter->filter( '1.000.000,00' );
$val should be 1000000 now, but is an array with date informations:
array ( [date_format] => dd.MM.yyyy, [locale] => de, [day] => 1, [month] => 000, [year] => 000 )
i posted that issue on zfforum.de: http://zfforum.de/showthread.php/?p=33370…
One answer is that it is possible that the 1.000.000,00 matches ISO-Dateformat on
line 101: Zend_Locale_Format::checkDateFormat($value, $this->_options)
Comments
Posted by Piotr Czachur (zimnyx) on 2009-05-19T03:18:10.000+0000
I've met similar problem while playing with locales and this filter.
When value "1,2.4" is passed to input amount, following error occours: preg_match() expects parameter 2 to be string, array given [trunk/lib/Zend/Locale/Format.php:515]
Posted by Stephan Wentz (swentz) on 2009-05-20T01:50:15.000+0000
We have the same problem here - with an integer '10000'. Result is:
array ( [date_format] => dd.MM.yyyy, [locale] => de_DE, [day] => 10, [month] => 00, [year] => 0 )
This makes Zend_Filter_LocalizedToNormalized absolutely unusable for us.
Posted by Thomas Weidner (thomas) on 2009-06-10T07:47:10.000+0000
Fixed with r15980.
Note that the value 1,2.4 is no number and will be detected as date.
Reason: Inputs like 01.02.04 -> 1. february 2004 or shortened also 1.2.4