summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-mwan3/luasrc
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2020-10-14 10:07:38 +0200
committerFlorian Eckert <fe@dev.tdt.de>2020-10-14 10:08:04 +0200
commit8c19a2e1b8f8bb5f28beadd71bab88d8f892d28d (patch)
treec8fbce6e1e7fb848c3263b036c1114cc04b77151 /applications/luci-app-mwan3/luasrc
parent3d1b6a12f61d876ccff246205b7a6440113116e3 (diff)
luci-app-mwan3: check policy name length on create
fixes #13499 Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc')
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua
index c2f47d6b21..9067f7332f 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua
@@ -53,9 +53,13 @@ mwan_policy.sortable = true
mwan_policy.template = "cbi/tblsection"
mwan_policy.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s")
function mwan_policy.create(self, section)
- TypedSection.create(self, section)
- m.uci:save("mwan3")
- luci.http.redirect(dsp.build_url("admin", "network", "mwan", "policy", section))
+ if #section > 15 then
+ self.invalid_cts = true
+ else
+ TypedSection.create(self, section)
+ m.uci:save("mwan3")
+ luci.http.redirect(dsp.build_url("admin", "network", "mwan", "policy", section))
+ end
end
use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned"))