1
0
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:
Ryan Cramer
2024-01-14 11:54:25 -05:00
parent 3717a85f3b
commit 1216340a46

View File

@@ -160,7 +160,6 @@ 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');
@@ -168,8 +167,7 @@ class InputfieldInteger extends Inputfield {
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")) {