mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -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
|
# Username
|
||||||
validate_format_username() {
|
validate_format_username() {
|
||||||
if ! [[ "$1" =~ ^[[:alnum:]]+([\.|_|-][[:alnum:]]+)?$ ]]; then
|
if ! [[ "$1" =~ ^[[:alnum:]][-|\.|_[:alnum:]]{0,28}[[:alnum:]]$ ]]; then
|
||||||
echo "Error: $2 $1 is not valid"
|
|
||||||
log_event "$E_INVALID" "$EVENT"
|
|
||||||
exit $E_INVALID
|
|
||||||
fi
|
|
||||||
if [[ "${#1}" -gt 28 ]]; then
|
|
||||||
echo "Error: $2 $1 is not valid"
|
echo "Error: $2 $1 is not valid"
|
||||||
log_event "$E_INVALID" "$EVENT"
|
log_event "$E_INVALID" "$EVENT"
|
||||||
exit $E_INVALID
|
exit $E_INVALID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue