Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class FirewallAlias extends Model {
default: [],
allow_empty: true,
many: true,
many_maximum: 0, // Do not enforce a maximum number of entries
delimiter: ' ',
help_text: "Sets the host, network or port entries for the alias. When `type` is set to `host`, each
entry must be a valid IP address or FQDN. When `type` is set to `network`, each entry must be a valid
Expand All @@ -59,6 +60,7 @@ class FirewallAlias extends Model {
default: [],
allow_empty: true,
many: true,
many_maximum: 0, // Do not enforce a maximum number of entries
delimiter: '||',
help_text: "Sets descriptions for each alias `address`. Values must match the order of the `address`
value it relates to. For example, the first value specified here is the description for the first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LengthValidator extends RESTAPI\Core\Validator {
);
}
# Throw an error if the string contains more characters than the specified maximum
if (strlen($value) > $this->maximum) {
if ($this->maximum and strlen($value) > $this->maximum) {
throw new ValidationError(
message: "Field '$field_name' exceeds the maximum character length of $this->maximum.",
response_id: 'LENGTH_VALIDATOR_MAXIMUM_CONSTRAINT',
Expand All @@ -61,7 +61,7 @@ class LengthValidator extends RESTAPI\Core\Validator {
);
}
# Throw an error if the array contains more array entries than the specified maximum
if (count($value) > $this->maximum) {
if ($this->maximum and count($value) > $this->maximum) {
throw new ValidationError(
message: "Field '$field_name' exceeds the maximum array length of $this->maximum.",
response_id: 'LENGTH_VALIDATOR_MAXIMUM_CONSTRAINT',
Expand Down