Skip to content

Commit c657960

Browse files
Merge pull request #746 from jaredhendrickson13/next_patch
v2.5.4 Fixes
2 parents 337ebc3 + c2834dd commit c657960

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/FirewallAlias.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class FirewallAlias extends Model {
4949
default: [],
5050
allow_empty: true,
5151
many: true,
52+
many_maximum: 0, // Do not enforce a maximum number of entries
5253
delimiter: ' ',
5354
help_text: "Sets the host, network or port entries for the alias. When `type` is set to `host`, each
5455
entry must be a valid IP address or FQDN. When `type` is set to `network`, each entry must be a valid
@@ -59,6 +60,7 @@ class FirewallAlias extends Model {
5960
default: [],
6061
allow_empty: true,
6162
many: true,
63+
many_maximum: 0, // Do not enforce a maximum number of entries
6264
delimiter: '||',
6365
help_text: "Sets descriptions for each alias `address`. Values must match the order of the `address`
6466
value it relates to. For example, the first value specified here is the description for the first

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/LengthValidator.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class LengthValidator extends RESTAPI\Core\Validator {
4444
);
4545
}
4646
# Throw an error if the string contains more characters than the specified maximum
47-
if (strlen($value) > $this->maximum) {
47+
if ($this->maximum and strlen($value) > $this->maximum) {
4848
throw new ValidationError(
4949
message: "Field '$field_name' exceeds the maximum character length of $this->maximum.",
5050
response_id: 'LENGTH_VALIDATOR_MAXIMUM_CONSTRAINT',
@@ -61,7 +61,7 @@ class LengthValidator extends RESTAPI\Core\Validator {
6161
);
6262
}
6363
# Throw an error if the array contains more array entries than the specified maximum
64-
if (count($value) > $this->maximum) {
64+
if ($this->maximum and count($value) > $this->maximum) {
6565
throw new ValidationError(
6666
message: "Field '$field_name' exceeds the maximum array length of $this->maximum.",
6767
response_id: 'LENGTH_VALIDATOR_MAXIMUM_CONSTRAINT',

0 commit comments

Comments
 (0)