Skip to content

Commit e94dd4a

Browse files
committed
improved domain validation
1 parent 33a8a57 commit e94dd4a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

func/main.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ validate_format_username() {
555555
# Domain
556556
validate_format_domain() {
557557
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
558-
dpart1=$(echo $1 | cut -f 1 -d .)
559-
if [[ "$1" =~ $exclude ]] || [ -z "$dpart1" ]; then
558+
if [[ "$1" =~ $exclude ]] || [[ "$1" =~ "^[0-9]+$" ]]; then
560559
echo "Error: domain $1 is not valid"
561560
log_event "$E_INVALID" "$EVENT"
562561
exit $E_INVALID

0 commit comments

Comments
 (0)