Project

General

Profile

« Previous | Next » 

Revision 351ef3ef

Added by Phil Davis over 8 years ago

Fix #7151 Misleading setHelp for Interface Group Name

Might as well use the same text as is given to the user in the error message already in this code.

View differences:

src/usr/local/www/interfaces_groups_edit.php
55 55

  
56 56
$interface_list = get_configured_interface_with_descr();
57 57
$interface_list_disabled = get_configured_interface_with_descr(false, true);
58
$ifname_allowed_chars_text = gettext("Only letters (A-Z), digits (0-9), '-' and '_' are allowed.");
59

  
58 60

  
59 61
if ($_POST) {
60 62
	unset($input_errors);
......
73 75
	}
74 76

  
75 77
	if (preg_match("/([^a-zA-Z0-9-_])+/", $_POST['ifname'])) {
76
		$input_errors[] = gettext("Only letters (A-Z), digits (0-9), '-' and '_' are allowed as the group name.");
78
		$input_errors[] = $ifname_allowed_chars_text . " " . gettext("Please choose another group name.");
77 79
	}
78 80

  
79 81
	if (preg_match("/[0-9]$/", $_POST['ifname'])) {
......
207 209
	'text',
208 210
	$pconfig['ifname'],
209 211
	['placeholder' => 'Group Name', 'maxlength' => "16"]
210
))->setWidth(6)->setHelp('No numbers or spaces are allowed. '.
211
	'Only characters: a-zA-Z');
212
))->setWidth(6)->setHelp($ifname_allowed_chars_text);
212 213

  
213 214
$section->addInput(new Form_Input(
214 215
	'descr',

Also available in: Unified diff