From 31330e0aed2a6bf2547bce3378e3830bd0f98e82 Mon Sep 17 00:00:00 2001 From: Rodrigo Fonseca Date: Thu, 16 Sep 2021 22:36:30 -0700 Subject: [PATCH] Fix starting check of username to allow numbers. The check for the first letter of username used to be !ctype_alpha, but the error message says "Must start with a letter or number." Updated check to be !ctype_alnum, to be coherent with the error message. --- app/Http/Controllers/Auth/RegisterController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index ab1db662..9a41f2e0 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -76,7 +76,7 @@ class RegisterController extends Controller return $fail('Username is invalid. Can only contain one dash (-), period (.) or underscore (_).'); } - if (!ctype_alpha($value[0])) { + if (!ctype_alnum($value[0])) { return $fail('Username is invalid. Must start with a letter or number.'); }