applications/wizard: Enforce hostname to conform to rfc952 and rfc1123
This commit is contained in:
parent
df5329a5cb
commit
94e437c2f0
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue