summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/interfaces_groups_edit.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-01-24 07:31:23 +0545
committerGitHub <noreply@github.com>2017-01-24 07:31:23 +0545
commitc1dc085bd20efbd8eb9ad3507413b743bcc108f6 (patch)
tree4bbe9cb472dc1987ade667aea2f221dc240b6c4f /src/usr/local/www/interfaces_groups_edit.php
parent3effec3b515a97e3b5820ba8687645868b807463 (diff)
parent5ac882de0bf5cc2e9a067d069a68d32096de20ca (diff)
downloadpfsense-c1dc085bd20efbd8eb9ad3507413b743bcc108f6.zip
pfsense-c1dc085bd20efbd8eb9ad3507413b743bcc108f6.tar.gz
Merge branch 'master' into patch-6
Diffstat (limited to 'src/usr/local/www/interfaces_groups_edit.php')
-rw-r--r--src/usr/local/www/interfaces_groups_edit.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php
index c164717..0657645 100644
--- a/src/usr/local/www/interfaces_groups_edit.php
+++ b/src/usr/local/www/interfaces_groups_edit.php
@@ -55,6 +55,9 @@ if (isset($id) && $a_ifgroups[$id]) {
$interface_list = get_configured_interface_with_descr();
$interface_list_disabled = get_configured_interface_with_descr(false, true);
+$ifname_allowed_chars_text = gettext("Only letters (A-Z), digits (0-9), '-' and '_' are allowed.");
+$ifname_no_digit_text = gettext("The group name cannot end with a digit.");
+
if ($_POST) {
unset($input_errors);
@@ -79,11 +82,11 @@ if ($_POST) {
}
if (preg_match("/([^a-zA-Z0-9-_])+/", $_POST['ifname'])) {
- $input_errors[] = gettext("Only letters (A-Z), digits (0-9), '-' and '_' are allowed as the group name.");
+ $input_errors[] = $ifname_allowed_chars_text . " " . gettext("Please choose another group name.");
}
if (preg_match("/[0-9]$/", $_POST['ifname'])) {
- $input_errors[] = gettext("Group name cannot end with digit.");
+ $input_errors[] = $ifname_no_digit_text;
}
/*
@@ -95,7 +98,7 @@ if ($_POST) {
}
foreach ($interface_list_disabled as $gif => $gdescr) {
- if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname']) {
+ if ((strcasecmp($gdescr, $_POST['ifname']) == 0) || (strcasecmp($gif, $_POST['ifname']) == 0)) {
$input_errors[] = "The specified group name is already used by an interface. Please choose another name.";
}
}
@@ -214,8 +217,7 @@ $section->addInput(new Form_Input(
'text',
$pconfig['ifname'],
['placeholder' => 'Group Name', 'maxlength' => "16"]
-))->setWidth(6)->setHelp('No numbers or spaces are allowed. '.
- 'Only characters: a-zA-Z');
+))->setWidth(6)->setHelp($ifname_allowed_chars_text . " " . $ifname_no_digit_text);
$section->addInput(new Form_Input(
'descr',
OpenPOWER on IntegriCloud