luci-base: fix host validation function 4053/head
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 13 May 2020 09:57:38 +0000 (11:57 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Tue, 19 May 2020 12:05:26 +0000 (14:05 +0200)
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>
modules/luci-base/htdocs/luci-static/resources/validation.js

index eea837d64ee5c77a53c711ac31035d132f7ab4da..02d7dbc37fd0402dd731f7da6bb5cdc7586fdb55 100644 (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'));
                },