OS info
- Operating System : Windows 10.0.22631
- Wappler Version : 7.0.1
- PHP
Problem description
Empty array always return true on Min Items
validation due to $length == 0
test and skipping the 2nd test for the entered value.
public function minitems($value, $param) {
$length = $this->getLength($value);
return $length == 0 || (is_array($value) && $length >= (int)$param);
}
Steps to reproduce
- Create an empty array.
- Add
Validate Data
step. - Add
Min Items
validation with a value of1
. - Validation should fail but passes.