summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-10-06 23:10:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-10-06 23:10:43 +0000
commitc802c941cb5892ac43ee865594d3e06b60c00ace (patch)
tree44848ec9cebea1193c33ec6990dff6adf83615f0 /libs/web/luasrc
parent9939dd2f72f42e547b6ad4cd3c9c068516fa0113 (diff)
libs/web: relax validation for hostnames to allow names like _kerberos._udp.EXAMPLE.COM
Diffstat (limited to 'libs/web/luasrc')
-rw-r--r--libs/web/luasrc/cbi/datatypes.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/web/luasrc/cbi/datatypes.lua b/libs/web/luasrc/cbi/datatypes.lua
index 48586194a..32530c465 100644
--- 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 (
- 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