Skip to content

Commit 988882d

Browse files
committed
Prevent creation tld less domains
Domains like com, www, test can't be created any more Prevent issues in hestiacp#1746 where www.conf got deleted
1 parent d6eb4bc commit 988882d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

func/main.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ is_user_format_valid() {
623623
is_domain_format_valid() {
624624
object_name=${2-domain}
625625
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
626-
if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ "\.\." ]] || [[ $1 =~ "$(printf '\t')" ]]; then
626+
if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ "\.\." ]] || [[ $1 =~ "$(printf '\t')" ]] || ! [[ $1 =~ "." ]]; then
627627
check_result $E_INVALID "invalid $object_name format :: $1"
628628
fi
629629
}

0 commit comments

Comments
 (0)