From 6a1411bb51c04ed9e77964e8f4c1cc41a411b05d Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Sat, 2 Oct 2021 14:54:58 -0700 Subject: [PATCH] validate_domain can start with numbers --- bin/vhost.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/vhost.sh b/bin/vhost.sh index 4a9788b..ac1a168 100755 --- a/bin/vhost.sh +++ b/bin/vhost.sh @@ -30,7 +30,7 @@ function vhost::set-phpVersion () { # crude but good enough domain name format validation function vhost::validate_domain () { 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 else return 1