From: Paul Donald Date: Fri, 10 Jan 2025 17:32:00 +0000 (+0100) Subject: luci-base: Enforce maximal firewall zone name length with fw3 only X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=a67d68353b2f55ff888e4a7062a31d9fccb70357;p=openwrt-luci.git luci-base: Enforce maximal firewall zone name length with fw3 only firewall3 enforces the zone name length. firewall4 does not. https://github.com/openwrt/luci/pull/7549#issuecomment-2583290810 Signed-off-by: Paul Donald --- diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index c697d7597e..99314bca5a 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -130,7 +130,7 @@ return view.extend({ o.placeholder = _('Unnamed zone'); o.modalonly = true; o.rmempty = false; - o.datatype = 'and(uciname,maxlength(11))'; + o.datatype = L.hasSystemFeature('firewall4') ? '' : 'and(uciname,maxlength(11))'; o.write = function(section_id, formvalue) { var cfgvalue = this.cfgvalue(section_id); diff --git a/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js b/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js index 4c9cd6924e..7368d6c523 100644 --- a/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js +++ b/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js @@ -148,7 +148,7 @@ var CBIZoneSelect = form.ListValue.extend({ display_items: this.display_size || this.size || 3, dropdown_items: this.dropdown_size || this.size || 5, validate: L.bind(this.validate, this, section_id), - datatype: 'and(uciname,maxlength(11))', + datatype: L.hasSystemFeature('firewall4') ? '' : 'and(uciname,maxlength(11))', create: !this.nocreate, create_markup: '' + '
  • ' +