luci-mod-network: dhcp.js: allow lease hostname to be empty
authorJo-Philipp Wich <jo@mein.io>
Sat, 11 Apr 2020 16:34:54 +0000 (18:34 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 57f27cf7f803cf1f788f6b3edb103c138aaa92f9)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index f58adc93a54848af090371a3353a5e456b97c8ab..6693dc0eacf4868a8900da94889b8a8dee4293d8 100644 (file)
@@ -66,6 +66,9 @@ CBILease6Status = form.DummyValue.extend({
 });
 
 function validateHostname(sid, s) {
+       if (s == null || s == '')
+               return true;
+
        if (s.length > 256)
                return _('Expecting: %s').format(_('valid hostname'));