projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/web: relax validation for hostnames to allow names like _kerberos._udp.EXAMPLE.COM
[project/luci.git]
/
libs
/
web
/
luasrc
/
cbi
/
datatypes.lua
diff --git
a/libs/web/luasrc/cbi/datatypes.lua
b/libs/web/luasrc/cbi/datatypes.lua
index 48586194a6e1a1a424febb22274604abe9c2e53a..32530c465ad9f1816db3fdba1b880b2dca27047a 100644
(file)
--- a/
libs/web/luasrc/cbi/datatypes.lua
+++ b/
libs/web/luasrc/cbi/datatypes.lua
@@
-179,8
+179,8
@@
end
function hostname(val)
if val and (#val < 254) and (
function hostname(val)
if val and (#val < 254) and (
- val:match("^[a-zA-Z]+$") or
- (val:match("^[a-zA-Z0-9
][a-zA-Z0-9
%-%.]*[a-zA-Z0-9]$") and
+ val:match("^[a-zA-Z
_
]+$") or
+ (val:match("^[a-zA-Z0-9
_][a-zA-Z0-9_
%-%.]*[a-zA-Z0-9]$") and
val:match("[^0-9%.]"))
) then
return true
val:match("[^0-9%.]"))
) then
return true