Version 5.0.0 beta 3

This commit is contained in:
Neo committed 2025-12-19 16:47:22 -08:00
1 parent f61b0da85d
commit e86153356a
108 files changed
+2927 -1573

No files matched your search

+5 -4
View File
@@ -84,7 +84,7 @@ class Number extends FormAbstract
{
/* Specify there's a value if the unlimited element contains a value */
$unlimitedName = "{$name}_unlimited";
if( isset( $options['unlimited'] ) and $options['unlimited'] !== NULL and isset( Request::i()->$unlimitedName ) )
if( isset( $options['unlimited'] ) and isset( Request::i()->$unlimitedName ) )
{
Request::i()->$name = $options['unlimited'];
}
@@ -231,12 +231,13 @@ class Number extends FormAbstract
{
throw new InvalidArgumentException( 'form_number_bad' );
}
if ( $this->options['min'] !== NULL and (int) $this->value < $this->options['min'] )
$valueToCheck = ( isset( $this->options['decimals'] ) and $this->options['decimals'] ) ? floatval( $this->value ) : (int) $this->value;
if ( $this->options['min'] !== NULL and $valueToCheck < $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'] )
if ( $this->options['max'] !== NULL and $valueToCheck > $this->options['max'] )
{
throw new LengthException( Member::loggedIn()->language()->addToStack('form_number_max', FALSE, array( 'sprintf' => array( $this->options['max'] ) ) ) );
}