From abcf79c6458b97d1f75b6c31020fdc7ab957d4f2 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Sat, 31 Jan 2026 18:26:09 -0500 Subject: [PATCH] feat: allow spaces in display names --- SharpbinV3.Server/DTOs/User/UpdateUserDto.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharpbinV3.Server/DTOs/User/UpdateUserDto.cs b/SharpbinV3.Server/DTOs/User/UpdateUserDto.cs index 0ab863f..2c4b785 100644 --- a/SharpbinV3.Server/DTOs/User/UpdateUserDto.cs +++ b/SharpbinV3.Server/DTOs/User/UpdateUserDto.cs @@ -19,7 +19,7 @@ namespace SharpbinV3.Server.DTOs if (DisplayName.Length < 3 || DisplayName.Length > 26) results.Add(new ValidationResult("DisplayName must be between 3 and 26 characters.", [nameof(DisplayName)])); if (!ValidateDisplayname().IsMatch(DisplayName)) - results.Add(new ValidationResult("DisplayName can only contain letters, numbers, underscores, and dots.", [nameof(DisplayName)])); + results.Add(new ValidationResult("DisplayName can only contain alphanumeric characters, underscores, periods, and spaces (no leading or trailing spaces).", [nameof(DisplayName)])); } if (Email != null) { @@ -47,7 +47,7 @@ namespace SharpbinV3.Server.DTOs return results; } - [GeneratedRegex("^[A-Za-z0-9_.]+$")] + [GeneratedRegex("^[A-Za-z0-9_.]+(?: [A-Za-z0-9_.]+)*$")] private static partial Regex ValidateDisplayname(); } }