Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Not an Issue
-
Affects Version/s: 1.9.0, 1.9.1, 1.9.2, 1.9.3
-
Fix Version/s: 1.9.4
-
Component/s: Zend_Validate
-
Labels:None
Description
My locale is et_EE
(Zend_Locale::setDefault(LOCALE); is set)
Float validator fails if I use construct method without locale - it won't chek default locale but uses localeconv() instead
So I tried to set php locale to et_EE (decimal_point is ",") but there is a bug when comapearing values in Float.php
$locale = localeconv();
$valueFiltered = str_replace($locale['thousands_sep'], '', (string) $value);
$valueFiltered = str_replace($locale['decimal_point'], '.', $valueFiltered);
if (strval(floatval($valueFiltered)) != $valueFiltered) { $this->_error(self::NOT_FLOAT); return false; }
$valueFiltered is something like 1.1 but floatval($valueFiltered) return 1,1 if you resest PHP's locale with setlocale()
Attachments
Issue Links
| This issue is duplicated by: | ||||
| ZF-7986 | Zend_Validate_Float without locale |
|
|
|
Why should Zend_Validate_Float work with the fallback locale from Zend_Locale ?
You set no locale to use for Zend_Validate_Float.
This means that Zend_Validate_Float works locale-independent.
It would be better when you say what's your problem.