Эх сурвалжийг харах

Merge pull request #1747 from jaapmarcus/fix/1746-tld-less-domains

Prevent creation tld less domains
Raphael Schneeberger 5 жил өмнө
parent
commit
a27f6aeffc
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" = "www" ]]; then
         check_result $E_INVALID "invalid $object_name format :: $1"
     fi
 }