applications/wizard: Enforce hostname to conform to rfc952 and rfc1123

This commit is contained in:
Manuel Munz 2011-01-20 02:06:48 +00:00
parent df5329a5cb
commit 94e437c2f0

View file

@ -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