fix form validate error

This commit is contained in:
joyqi
2025-06-05 15:10:47 +08:00
parent 7ef2c08a96
commit ba4e4134ad

View File

@@ -334,6 +334,8 @@ class Validate
*/
public function required(): bool
{
return array_key_exists($this->key, $this->data);
return array_key_exists($this->key, $this->data) &&
(is_array($this->data[$this->key]) ? 0 < count($this->data[$this->key])
: 0 < strlen($this->data[$this->key]));
}
}