if ( $this->options['min'] !== NULL and (int) $this->value < $this->options['min'] )
{
throw new LengthException( Member::loggedIn()->language()->addToStack('form_number_min', FALSE, array( 'sprintf' => array( $this->options['min'] ) ) ) );
}
if ( $this->options['max'] !== NULL and (int) $this->value > $this->options['max'] )
{
throw new LengthException( Member::loggedIn()->language()->addToStack('form_number_max', FALSE, array( 'sprintf' => array( $this->options['max'] ) ) ) );
}
The above casts to INT invalidates minimums and maximums that are FLOAT values such as 0.3. 9.6, etc... You get an entertaining validation message back too 😛
An extra check for floats there would be much appreciated.
Recommended Comments