From 64950748cf1ba978835df8ed0ed797bd1806413c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 5 Sep 2019 21:29:12 -0600 Subject: [PATCH] Update RegisterController --- app/Http/Controllers/Auth/RegisterController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index efda66a4..713ffe63 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -63,17 +63,17 @@ class RegisterController extends Controller 'unique:users', function ($attribute, $value, $fail) { if (!ctype_alpha($value[0])) { - return $fail($attribute.' is invalid. Username must be alpha-numeric and start with a letter.'); + return $fail('Username is invalid. Username must be alpha-numeric and start with a letter.'); } - $val = str_replace(['-', '_'], '', $value); + $val = str_replace(['_', '-', '.'], '', $value); if(!ctype_alnum($val)) { - return $fail($attribute . ' is invalid. Username must be alpha-numeric.'); + return $fail('Username is invalid. Username must be alpha-numeric and may contain dashes (-), periods (.) and underscores (_).'); } }, ]; $rules = [ - 'name' => 'required|string|max:'.config('pixelfed.max_name_length'), + 'name' => 'nullable|string|max:'.config('pixelfed.max_name_length'), 'username' => $usernameRules, 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|min:8|confirmed',