Skip to content

Commit e57a727

Browse files
fix: skip empty access_list subnets in ui page
1 parent 7be6c0f commit e57a727

File tree

1 file changed

+7
-0
lines changed
  • pfSense-pkg-API/files/usr/local/www/api

1 file changed

+7
-0
lines changed

pfSense-pkg-API/files/usr/local/www/api/index.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@
148148
# Check each subnet within the access list to ensure it is valid
149149
foreach ($access_list_raw as $subnet) {
150150
$subnet = trim($subnet);
151+
152+
# Skip this subnet if it is empty
153+
if (empty($subnet)) {
154+
continue;
155+
}
156+
157+
# Ensure the subnet is a valid IPv4 or IPv6 CIDR
151158
if (!is_subnet($subnet)) {
152159
$input_errors[] = "Access list entry '".$subnet."' is not a valid IPv4 or IPv6 CIDR.";
153160
$has_errors = true;

0 commit comments

Comments
 (0)