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 <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2020-05-13 11:57:38 +02:00
parent da7c3d9202
commit c8d24f04de

View file

@ -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'));
},