Issues

ZF-11276: Zend_Validate_Between

Description

H Zend Team, like i saw the Zend_Validate_Between supports only english float values like "2.09". It would be an good if it would support europe float convetion like "2,09". Here is my sulution: Replace isValid Mehtod by this:

public function isValid($value) { $this->_setValue($value);

$filter = new Zend_Filter_PregReplace(array('match' => '/\,/',
                                            'replace' => '.'));
$value = $filter->filter($value);

if ($this->_inclusive) {
    if ($this->_min > $value || $value > $this->_max) {
        $this->_error(self::NOT_BETWEEN);
        return false;
    }
} else {
    if ($this->_min >= $value || $value >= $this->_max) {
        $this->_error(self::NOT_BETWEEN_STRICT);
        return false;
    }
}
return true;

}

Comments

Duplication of ZF-6577

Closing as duplicate

Note that the attached patch will not be integrated as it's behaviour is errorous.

Because of the $this->_setValue($value); , or? filter than may fail?

No.. the preg_replace itself would allow german numbers be validated in english environment and visa-versa. When we support localization then eighter all or non. The other issue was intended to add full localization. Therefor closing as duplicate and non-integration for this issue.