diff options
author | Paul Donald <newtwen@gmail.com> | 2024-01-25 01:05:15 +0100 |
---|---|---|
committer | Paul Donald <newtwen@gmail.com> | 2024-01-25 01:09:12 +0100 |
commit | f6cbda00e77afc26c12da3c31e5f5444cee17422 (patch) | |
tree | 214f6e1399c2f804f0ecf1c4d32c26bc9612a402 | |
parent | 754b36d05ac26e1ddc68d8726e01faa38f9fe948 (diff) |
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>
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index 2c141d3078..2967e99b47 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -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'); |