From c8d24f04de577156236561131f3e4ea9620c46bd Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 13 May 2020 11:57:38 +0200 Subject: [PATCH] luci-base: fix host validation function Allow only ipv4 or ipv6 addresses without IP mask. A host IP with mask does not make sense in this context. Signed-off-by: Florian Eckert --- modules/luci-base/htdocs/luci-static/resources/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index eea837d64..02d7dbc37 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -337,7 +337,7 @@ var ValidatorFactory = baseclass.extend({ }, host: function(ipv4only) { - return this.assert(this.apply('hostname') || this.apply(ipv4only == 1 ? 'ip4addr' : 'ipaddr'), + return this.assert(this.apply('hostname') || this.apply(ipv4only == 1 ? 'ip4addr' : 'ipaddr', null, ['nomask']), _('valid hostname or IP address')); }, -- 2.25.1