Explorar o código

Merge pull request #1577 from moucho/error_tab

Do not allow {tab} as a valid character for a domain
dpeca %!s(int64=7) %!d(string=hai) anos
pai
achega
b8375c5833
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      func/main.sh

+ 1 - 1
func/main.sh

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