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:
parent
f7b2096fa2
commit
b2999bb6b2
64 changed files with 2089 additions and 2008 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue