mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Update to previous commit
This commit is contained in:
@@ -160,16 +160,14 @@ class InputfieldInteger extends Inputfield {
|
|||||||
if($key === 'value') {
|
if($key === 'value') {
|
||||||
$value = $this->sanitizeValue($value);
|
$value = $this->sanitizeValue($value);
|
||||||
if(strlen("$value") && !$this->isInRange($value)) {
|
if(strlen("$value") && !$this->isInRange($value)) {
|
||||||
if($value) {
|
// apply the following only for non-zero values
|
||||||
// apply the following only for non-zero values
|
$min = (string) $this->attr('min');
|
||||||
$min = (string) $this->attr('min');
|
$max = (string) $this->attr('max');
|
||||||
$max = (string) $this->attr('max');
|
$any = $this->_('any'); // referring to “any” minimum or maximum number
|
||||||
$any = $this->_('any'); // referring to “any” minimum or maximum number
|
if(!strlen("$min")) $min = $any;
|
||||||
if(!strlen("$min")) $min = $any;
|
if(!strlen("$max")) $max = $any;
|
||||||
if(!strlen("$max")) $max = $any;
|
$this->error(sprintf($this->_('Specified value %3$s removed because it is out of bounds (min=%1$s, max=%2$s)'), $min, $max, $value));
|
||||||
$this->error(sprintf($this->_('Specified value %3$s removed because it is out of bounds (min=%1$s, max=%2$s)'), $min, $max, $value));
|
$value = $this->val();
|
||||||
}
|
|
||||||
$value = $this->val(); // restore previous value
|
|
||||||
}
|
}
|
||||||
} else if($key === 'min' || $key === 'max') {
|
} else if($key === 'min' || $key === 'max') {
|
||||||
if(strlen("$value")) {
|
if(strlen("$value")) {
|
||||||
|
Reference in New Issue
Block a user