From 0c1be9ae5380d0ac11cccfe152a158eee5bd7125 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sat, 14 Jan 2023 10:40:43 +0200 Subject: luci-mod-network: Add length restriction to wireless interface name Based on issue #6101, add a maxlength of 15 chars to the wireless interface's optional name field. Also validate it as uciname. Signed-off-by: Hannu Nyman --- .../htdocs/luci-static/resources/view/network/wireless.js | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/luci-mod-network/htdocs/luci-static/resources/view') diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 420b381e2f..de3eacff23 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -1159,6 +1159,7 @@ return view.extend({ o = ss.taboption('advanced', form.Value, 'ifname', _('Interface name'), _('Override default interface name')); o.optional = true; + o.datatype = 'and(uciname,maxlength(15))'; o.placeholder = radioNet.getIfname(); if (/^radio\d+\.network/.test(o.placeholder)) o.placeholder = ''; -- cgit v1.2.3