luci-app-firewall: use more strict validation for zone names

they shall not begin with a digit.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2025-12-03 16:54:29 +01:00
parent de5ddebeed
commit 97733541e5

View File

@@ -130,7 +130,7 @@ return view.extend({
o.placeholder = _('Unnamed zone'); o.placeholder = _('Unnamed zone');
o.modalonly = true; o.modalonly = true;
o.rmempty = false; o.rmempty = false;
o.datatype = L.hasSystemFeature('firewall4') ? 'uciname' : 'and(uciname,maxlength(11))'; o.datatype = L.hasSystemFeature('firewall4') ? 'ucifw4zonename' : 'and(ucifw4zonename,maxlength(11))';
o.write = function(section_id, formvalue) { o.write = function(section_id, formvalue) {
var cfgvalue = this.cfgvalue(section_id); var cfgvalue = this.cfgvalue(section_id);