From 94e437c2f02fbca2b88a0f9d7e12bfd1a4d864a4 Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Thu, 20 Jan 2011 02:06:48 +0000 Subject: applications/wizard: Enforce hostname to conform to rfc952 and rfc1123 --- applications/luci-ffwizard/luasrc/model/cbi/ffwizard.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'applications') 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 -- cgit v1.2.3