luci-mod-network: improve static lease ip validation logic
m (mac) is an array, and is zero length or greater. Signed-off-by: Paul Donald <newtwen@gmail.com>
This commit is contained in:
parent
754b36d05a
commit
f6cbda00e7
1 changed files with 2 additions and 2 deletions
|
@ -942,10 +942,10 @@ return view.extend({
|
|||
var m = this.section.formvalue(section, 'mac'),
|
||||
n = this.section.formvalue(section, 'name');
|
||||
|
||||
if ((m == null || m == '') && (n == null || n == ''))
|
||||
if ((m && !m.length > 0) && !n)
|
||||
return _('One of hostname or MAC address must be specified!');
|
||||
|
||||
if (value == null || value == '' || value == 'ignore')
|
||||
if (!value || value == 'ignore')
|
||||
return true;
|
||||
|
||||
var leases = uci.sections('dhcp', 'host');
|
||||
|
|
Loading…
Reference in a new issue