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 <hannu.nyman@iki.fi>
This commit is contained in:
Hannu Nyman 2023-01-14 10:40:43 +02:00
parent 77f2d8895b
commit 0c1be9ae53

View file

@ -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 = '';