Преглед на файлове

Prevent creation tld less domains

Domains like
com, www, test can't be created any more 

Prevent issues in #1746 where www.conf got deleted
Jaap Marcus преди 4 години
родител
ревизия
988882d901
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      func/main.sh

+ 1 - 1
func/main.sh

@@ -623,7 +623,7 @@ is_user_format_valid() {
 is_domain_format_valid() {
     object_name=${2-domain}
     exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
-    if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ "\.\." ]] || [[ $1 =~ "$(printf '\t')" ]]; then
+    if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ "\.\." ]] || [[ $1 =~ "$(printf '\t')" ]] || ! [[ $1 =~ "." ]]; then
         check_result $E_INVALID "invalid $object_name format :: $1"
     fi
 }