Details
Description
Zend_Filter_LocalizedToNormalized does not behave in an intuitive manner.
Example 1
When passing in a value such as 23,555.0 the value returned is 23555.0 which is acceptable.
Expected
-------------
Commas are stripped out
Example 2
When passing in a malformed numeric value from a form such as 23.05.1 the class returns a date.
Expected:
-------------
i) Return value should be 23.05 with extra characters removed.
ii) Alternatively the class should be configurable to return a value with all but the first decimal point removed. 23.051
Conclusion
==========
The fact that the class returns unexpected data makes it unsafe to use when validating Numeric or Date data.
The class should either be removed from the framework or redesigned to remove the inherently confused design issues.
When you need to validate numbers or dates then use Validators.
Filters are not Validators, and they should not be used with unvalidated content.
When you give a localized value to this filter then it will be normalized.
And when the value is detected as localized date, then you will get a normalized date in return.
Use Zend_Validate_Float/Int/Digits to get sure if the value is a number.