mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #3571 from znz/simplify-hostname_regex
Simplify hostname_regex
This commit is contained in:
@@ -312,7 +312,7 @@ is_global_vhost_enabled() {
|
||||
is_valid_hostname() {
|
||||
declare desc="return 0 if argument is a valid hostname; else return 1"
|
||||
local hostname_string="${1,,}"
|
||||
local hostname_regex='^([a-z0-9\.\*-]+\.)*[a-z0-9\*-]+$'
|
||||
local hostname_regex='^[a-z0-9\.\*-]*[a-z0-9\*-]$'
|
||||
if [[ $hostname_string =~ $hostname_regex ]]; then
|
||||
return 0
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user