Prevent < and > being used in service names (#437)

This commit is contained in:
Tim Wilkinson 2022-07-18 06:46:01 -07:00 committed by GitHub
parent ba55aed754
commit 675beca8f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -88,7 +88,7 @@ function navbar()
end end
function validate_service_name(name) function validate_service_name(name)
if not name or name == "" or name:match("[:-\"|]") then if not name or name == "" or name:match("[:-\"|<>]") then
return false return false
else else
return true return true
@ -96,7 +96,7 @@ function validate_service_name(name)
end end
function validate_service_protocol(proto) function validate_service_protocol(proto)
if not proto or proto == "" or proto:match("[:-\"|]") or not proto:match("^%w+") then if not proto or proto == "" or proto:match("[:-\"|<>]") or not proto:match("^%w+") then
return false return false
else else
return true return true
@ -104,7 +104,7 @@ function validate_service_protocol(proto)
end end
function validate_service_suffix(suffix) function validate_service_suffix(suffix)
if not suffix or suffix:match("[:-\"|]") or not suffix:match("^[%w/?._=#-]*$") then if not suffix or suffix:match("[:-\"|<>]") or not suffix:match("^[%w/?._=#-]*$") then
return false return false
else else
return true return true
@ -113,7 +113,7 @@ end
local serv_err = {} local serv_err = {}
function serverr(msg) function serverr(msg)
serv_err[#serv_err + 1] = msg serv_err[#serv_err + 1] = msg:gsub(">", "&gt;"):gsub("<", "&lt;")
end end
local port_err = {} local port_err = {}
function porterr(msg) function porterr(msg)