Parcourir la source

improved domain validation

Serghey Rodin il y a 13 ans
Parent
commit
e94dd4afa1
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      func/main.sh

+ 1 - 2
func/main.sh

@@ -555,8 +555,7 @@ validate_format_username() {
 # Domain
 validate_format_domain() {
     exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
-    dpart1=$(echo $1 | cut -f 1 -d .)
-    if [[ "$1" =~ $exclude ]] || [ -z "$dpart1" ]; then
+    if [[ "$1" =~ $exclude ]] || [[ "$1" =~ "^[0-9]+$" ]]; then
         echo "Error: domain $1 is not valid"
         log_event "$E_INVALID" "$EVENT"
         exit $E_INVALID