diff options
author | Florian Eckert <fe@dev.tdt.de> | 2020-10-14 10:07:52 +0200 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2020-10-14 10:08:17 +0200 |
commit | 678c0b2d5ba77092ca4c422b6a3c3e3eefe86b01 (patch) | |
tree | 94da6c363ef151273f82a88d0c4c75fcbecc236c /applications/luci-app-mwan3 | |
parent | 8c19a2e1b8f8bb5f28beadd71bab88d8f892d28d (diff) |
luci-app-mwan3: check rule name length on create
fixes #13499
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3')
-rw-r--r-- | applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua index a197930a4..1a97d40c1 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua @@ -61,9 +61,13 @@ mwan_rule.sortable = true mwan_rule.template = "cbi/tblsection" mwan_rule.extedit = dsp.build_url("admin", "network", "mwan", "rule", "%s") function mwan_rule.create(self, section) - TypedSection.create(self, section) - m.uci:save("mwan3") - luci.http.redirect(dsp.build_url("admin", "network", "mwan", "rule", 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", "rule", section)) + end end src_ip = mwan_rule:option(DummyValue, "src_ip", translate("Source address")) |