1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update luci-base

This commit is contained in:
Ycarus 2018-05-09 15:20:50 +02:00
parent f7b2096fa2
commit b2999bb6b2
64 changed files with 2089 additions and 2008 deletions

View file

@ -199,13 +199,13 @@ function macaddr(val)
return ip.checkmac(val) and true or false
end
function hostname(val)
function hostname(val, strict)
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("[^0-9%.]"))
) then
return true
return (not strict or not val:match("^_"))
end
return false
end