mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
fix for domain validator
This commit is contained in:
parent
f5acec8c3c
commit
430abcd0e0
1 changed files with 2 additions and 3 deletions
|
@ -478,9 +478,8 @@ is_user_format_valid() {
|
|||
# Domain format validator
|
||||
is_domain_format_valid() {
|
||||
object_name=${2-domain}
|
||||
mask1='(([[:alnum:]](-?[[:alnum:]])*)\.)'
|
||||
mask2='*[[:alnum:]](-?[[:alnum:]])+\.[[:alnum:]]{2,}'
|
||||
if ! [[ "$1" =~ ^${mask1}${mask2}$ ]]; then
|
||||
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
|
||||
if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ \.\. ]]; then
|
||||
check_result $E_INVALID "invalid $object_name format :: $1"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue