Project

General

Profile

« Previous | Next » 

Revision 3692adec

Added by Phil Davis over 8 years ago

Interface description must be unique including case

View differences:

src/usr/local/www/interfaces.php
490 490
	}
491 491
	/* description unique? */
492 492
	foreach ($ifdescrs as $ifent => $ifdescr) {
493
		if ($if != $ifent && $ifdescr == $_POST['descr']) {
493
		if ($if != $ifent && (strcasecmp($ifdescr, $_POST['descr']) == 0)) {
494 494
			$input_errors[] = gettext("An interface with the specified description already exists.");
495 495
			break;
496 496
		}
......
499 499
	/* Is the description already used as an alias name? */
500 500
	if (is_array($config['aliases']['alias'])) {
501 501
		foreach ($config['aliases']['alias'] as $alias) {
502
			if ($alias['name'] == $_POST['descr']) {
502
			if (strcasecmp($alias['name'], $_POST['descr']) == 0) {
503 503
				$input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $_POST['descr']);
504 504
			}
505 505
		}
......
508 508
	/* Is the description already used as an interface group name? */
509 509
	if (is_array($config['ifgroups']['ifgroupentry'])) {
510 510
		foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) {
511
			if ($ifgroupentry['ifname'] == $_POST['descr']) {
511
			if (strcasecmp($ifgroupentry['ifname'], $_POST['descr']) == 0) {
512 512
				$input_errors[] = sprintf(gettext("Sorry, an interface group with the name %s already exists."), $wancfg['descr']);
513 513
			}
514 514
		}

Also available in: Unified diff