Skip to content

Commit 430abcd

Browse files
committed
fix for domain validator
1 parent f5acec8 commit 430abcd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

func/main.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,8 @@ is_user_format_valid() {
478478
# Domain format validator
479479
is_domain_format_valid() {
480480
object_name=${2-domain}
481-
mask1='(([[:alnum:]](-?[[:alnum:]])*)\.)'
482-
mask2='*[[:alnum:]](-?[[:alnum:]])+\.[[:alnum:]]{2,}'
483-
if ! [[ "$1" =~ ^${mask1}${mask2}$ ]]; then
481+
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
482+
if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ \.\. ]]; then
484483
check_result $E_INVALID "invalid $object_name format :: $1"
485484
fi
486485
}

0 commit comments

Comments
 (0)