mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
fixed underscore bug in user validation function
This commit is contained in:
parent
df569188d4
commit
902ed117dd
1 changed files with 6 additions and 2 deletions
|
@ -556,8 +556,12 @@ validate_format_email() {
|
||||||
|
|
||||||
# Username
|
# Username
|
||||||
validate_format_username() {
|
validate_format_username() {
|
||||||
if ! [[ "$1" =~ ^[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?$ ]] || [[ "${#1}" -gt 28 ]]
|
if ! [[ "$1" =~ ^[a-zA-Z0-9]+([\.|_][a-zA-Z0-9]+)?$ ]]; then
|
||||||
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