Merge pull request #451 from hnyman/fw-zone-len
luci-app-firewall: validate zone name to enforce fw3 max. length
This commit is contained in:
commit
c48fbfa992
1 changed files with 9 additions and 0 deletions
|
@ -76,6 +76,15 @@ function name.write(self, section, value)
|
||||||
}
|
}
|
||||||
end
|
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 = {
|
p = {
|
||||||
s:taboption("general", ListValue, "input", translate("Input")),
|
s:taboption("general", ListValue, "input", translate("Input")),
|
||||||
s:taboption("general", ListValue, "output", translate("Output")),
|
s:taboption("general", ListValue, "output", translate("Output")),
|
||||||
|
|
Loading…
Reference in a new issue