diff options
author | Manuel Munz <freifunk@somakoma.de> | 2011-01-20 02:06:48 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2011-01-20 02:06:48 +0000 |
commit | 94e437c2f02fbca2b88a0f9d7e12bfd1a4d864a4 (patch) | |
tree | d39e5429e7ceac6b9a2e6822688c0136fde33bf1 /applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua | |
parent | df5329a5cbc46710392d12e72e28549a9c6bf691 (diff) |
applications/wizard: Enforce hostname to conform to rfc952 and rfc1123
Diffstat (limited to 'applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua')
-rw-r--r-- | applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua b/applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua index 0cc26e592..73ec41e7e 100644 --- a/applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua +++ b/applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua @@ -121,9 +121,7 @@ function hostname.write(self, section, value) uci:save("freifunk") end function hostname.validate(self, value) - if (#value > 16) then - return - elseif (string.find(value, "[^%w%_%-]")) then + if (#value > 24) or string.find(value, "[^%w%.%-]") or string.find(string.sub(value, value:len()), "[%.%-]") or string.find(string.sub(value, 1), "[%.%-]") then return else return value |