luci-mod-network: Add length restriction to wireless interface name
authorHannu Nyman <[email protected]>
Sat, 14 Jan 2023 08:40:43 +0000 (10:40 +0200)
committerJo-Philipp Wich <[email protected]>
Mon, 3 Apr 2023 11:46:20 +0000 (13:46 +0200)
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 <[email protected]>
(cherry picked from commit 0c1be9ae5380d0ac11cccfe152a158eee5bd7125)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index 1c1c1218f6f1f0e3f101d158d07e65f5434627fa..6f2199f567503c4035bf6312cf2e895ee3ad1015 100644 (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 = '';