mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Merge pull request #1091 from Skamasle/patch-16
Fix DNS issue whit some characters
This commit is contained in:
commit
de6eb649ea
1 changed files with 17 additions and 2 deletions
19
func/main.sh
19
func/main.sh
|
@ -594,10 +594,25 @@ is_common_format_valid() {
|
|||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
if [[ $1 =~ \* ]]; then
|
||||
if [ "$(echo $1 | grep -o '*'|wc -l)" -gt 1 ]; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
if [[ "$(echo $1 | grep -o '\*\.' |wc -l)" -eq 0 ]] && [[ $1 != '*' ]] ; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
fi
|
||||
if [[ $(echo -n "$1" | tail -c 1) =~ [^a-zA-Z0-9_*@] ]]; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
if [[ $(echo -n "$1" | grep -c '\.\.') -gt 0 ]];then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
if [[ $(echo -n "$1" | head -c 1) =~ [^a-zA-Z0-9_*@] ]]; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
if [[ $(echo -n "$1" | grep -c '\-\-') -gt 0 ]]; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
if [[ $(echo -n "$1" | grep -c '\_\_') -gt 0 ]]; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Database format validator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue