mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
imprvoved validator
This commit is contained in:
parent
55b905f86a
commit
a8a86aced9
1 changed files with 1 additions and 6 deletions
|
@ -556,12 +556,7 @@ validate_format_email() {
|
|||
|
||||
# Username
|
||||
validate_format_username() {
|
||||
if ! [[ "$1" =~ ^[[:alnum:]]+([\.|_|-][[:alnum:]]+)?$ ]]; then
|
||||
echo "Error: $2 $1 is not valid"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
if [[ "${#1}" -gt 28 ]]; then
|
||||
if ! [[ "$1" =~ ^[[:alnum:]][-|\.|_[:alnum:]]{0,28}[[:alnum:]]$ ]]; then
|
||||
echo "Error: $2 $1 is not valid"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue