validate_domain can start with numbers

This commit is contained in:
Matthew Saunders Brown 2021-10-02 14:54:58 -07:00
parent 68a8af5409
commit 6a1411bb51

View File

@ -30,7 +30,7 @@ function vhost::set-phpVersion () {
# crude but good enough domain name format validation # crude but good enough domain name format validation
function vhost::validate_domain () { function vhost::validate_domain () {
local my_domain=$1 local my_domain=$1
if [[ $my_domain =~ ^(([a-zA-Z](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}$ ]] ; then if [[ $my_domain =~ ^(([a-zA-Z0-9](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}$ ]] ; then
return 0 return 0
else else
return 1 return 1