Skip to content

Commit

Permalink
interfaces: long group names vs. pf(4)
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Apr 26, 2019
1 parent 6b8fc10 commit d40c917
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/www/interfaces_groups_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@
}
}
}
if (preg_match("/([^a-zA-Z0-9_])+/", $pconfig['ifname'], $match) || empty($pconfig['ifname'])) {
$input_errors[] = gettext("Only letters A-Z are allowed as the group name.");

if (preg_match('/([^a-zA-Z0-9_])+/', $pconfig['ifname'], $match) || empty($pconfig['ifname'])) {
$input_errors[] = gettext('Only letters, digits and underscores are allowed as the group name.');
}

if (!empty($pconfig['ifname']) && strlen($pconfig['ifname']) > 15) {
$input_errors[] = gettext('The group name shall not be longer than 15 characters.');
}

foreach (get_configured_interface_with_descr() as $gif => $gdescr) {
Expand Down

0 comments on commit d40c917

Please sign in to comment.