Zend Framework

Zend_Validate_Float without locale

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.9.3
  • Fix Version/s: None
  • Component/s: Zend_Validate
  • Labels:
    None

Description

My locale is et_EE

Zend_Locale::setDefault(LOCALE); is set

But validator fails if I use construct it without locale - it won't chek default locale but uses localeconv() instead

So I tried to set php locale to et_EE 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()

Issue Links

Activity

Hide
Satoru Yoshida added a comment -

It would be duplicate of ZF-7987

Show
Satoru Yoshida added a comment - It would be duplicate of ZF-7987

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: