Przeglądaj źródła

new pregmatch for user function

Serghey Rodin 13 lat temu
rodzic
commit
1aa19c01a0
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      func/main.sh

+ 2 - 1
func/main.sh

@@ -556,7 +556,8 @@ validate_format_email() {
 
 
 # Username
 # Username
 validate_format_username() {
 validate_format_username() {
-    if ! [[ "$1" =~ ^[0-z]+(\.[0-z]+)?$ ]] || [[ "${#1}" -gt 28 ]]; then
+    if ! [[ "$1" =~ ^[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?$ ]] || [[ "${#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