mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
improved domain validation
This commit is contained in:
parent
33a8a577a4
commit
e94dd4afa1
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue