X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-firewall%2Fluasrc%2Fmodel%2Fcbi%2Ffirewall%2Fzone-details.lua;h=46b3744403087998a13ee65af7616c8be63b96d4;hp=3eb95ebb57a916b334c80ced09a568192d1fb465;hb=34e875b;hpb=084d435060f73a8e098c8022a43bd9f5b1fd63ca diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua index 3eb95ebb5..46b374440 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua @@ -76,6 +76,15 @@ function name.write(self, section, value) } end +function name.validate(self, value) + -- fw3 defines 14 as the maximum length of zone name + if #value > 14 then + return nil, translate("Zone name is too long") + else + return value + end +end + p = { s:taboption("general", ListValue, "input", translate("Input")), s:taboption("general", ListValue, "output", translate("Output")),