Project

General

Profile

« Previous | Next » 

Revision 4a71c087

Added by Ermal LUÇI almost 15 years ago

Fixes #745. Validate group name against existing interfaces.

View differences:

usr/local/www/interfaces_groups_edit.php
71 71
	if (preg_match("/([^a-zA-Z])+/", $_POST['ifname'], $match))
72 72
		$input_errors[] = "Only letters A-Z are allowed as the group name.";
73 73

  
74
	$ifaces = get_configured_interface_with_descr();
75
	foreach ($ifaces as $gif => $gdescr) {
76
		if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname'])
77
			$input_errors[] = "The specified group name is already used by an interface. Please choose another name.";
78
	}
74 79
	$ifgroupentry = array();
75 80
	$ifgroupentry['ifname'] = $_POST['ifname'];
76 81
	$members = "";

Also available in: Unified diff