diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index f9ba3b648..5217a9925 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -65,7 +65,7 @@ class RegisterController extends Controller ]; $rules = [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max' . config('pixelfed.max_name_length'), 'username' => $usernameRules, 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|min:6|confirmed', diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index ab8f35ce9..14eced67c 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -30,8 +30,8 @@ class SettingsController extends Controller public function homeUpdate(Request $request) { $this->validate($request, [ - 'name' => 'required|string|max:30', - 'bio' => 'nullable|string|max:125', + 'name' => 'required|string|max:' . config('pixelfed.max_name_length'), + 'bio' => 'nullable|string|max:' . config('pixelfed.max_bio_length') 'website' => 'nullable|url', 'email' => 'nullable|email' ]); diff --git a/config/pixelfed.php b/config/pixelfed.php index b33c6c885..b675f4080 100644 --- a/config/pixelfed.php +++ b/config/pixelfed.php @@ -108,6 +108,26 @@ return [ */ 'max_caption_length' => env('MAX_CAPTION_LENGTH', 500), + /* + |-------------------------------------------------------------------------- + | Bio length limit + |-------------------------------------------------------------------------- + | + | Change the bio length limit for user profiles. + | + */ + 'max_bio_length' => env('MAX_BIO_LENGTH', 125), + + /* + |-------------------------------------------------------------------------- + | User name length limit + |-------------------------------------------------------------------------- + | + | Change the length limit for user names. + | + */ + 'max_name_length' => env('MAX_NAME_LENGTH', 30), + /* |-------------------------------------------------------------------------- | Album size limit @@ -138,4 +158,4 @@ return [ */ 'image_quality' => (int) env('IMAGE_QUALITY', 80), -]; \ No newline at end of file +]; diff --git a/resources/views/settings/home.blade.php b/resources/views/settings/home.blade.php index 4c43b306d..18f78e3f1 100644 --- a/resources/views/settings/home.blade.php +++ b/resources/views/settings/home.blade.php @@ -39,6 +39,9 @@