Merge pull request #848 from rrobgill/test

Sub-domains regexp fix
This commit is contained in:
4s3ti 2019-10-17 10:55:38 +02:00 committed by GitHub
commit 1f523cbe69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -389,8 +389,7 @@ function valid_domain()
local domain=$1 local domain=$1
local stat=1 local stat=1
if [[ $domain =~ ^(([a-zA-Z0-9]{1,63}|([a-zA-Z0-9]{1,60}[-a-zA-Z0-9()]{0,2}[a-zA-Z0-9]{1,60}))\.){1,6}([a-zA-Z]{2,})$ ]]; then
if [[ $domain =~ ^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}\.[a-zA-Z]{2,}$ ]]; then
stat=$? stat=$?
fi fi
return $stat return $stat