We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df56918 commit 902ed11Copy full SHA for 902ed11
func/main.sh
@@ -556,8 +556,12 @@ validate_format_email() {
556
557
# Username
558
validate_format_username() {
559
- if ! [[ "$1" =~ ^[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?$ ]] || [[ "${#1}" -gt 28 ]]
560
- then
+ if ! [[ "$1" =~ ^[a-zA-Z0-9]+([\.|_][a-zA-Z0-9]+)?$ ]]; then
+ echo "Error: $2 $1 is not valid"
561
+ log_event "$E_INVALID" "$EVENT"
562
+ exit $E_INVALID
563
+ fi
564
+ if [[ "${#1}" -gt 28 ]]; then
565
echo "Error: $2 $1 is not valid"
566
log_event "$E_INVALID" "$EVENT"
567
exit $E_INVALID
0 commit comments