diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-02-20 12:04:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-20 12:04:43 +0100 |
| commit | 51e0ce7ea4cdbaf3f6b0edfc9a3440b56077cc85 (patch) | |
| tree | 2b14670c82cb977aecf4373ec8c62e174ec2c426 /Jellyfin.Server.Implementations/Users/UserManager.cs | |
| parent | 0dbd875dd0586eeeb15cf762d0b19dd41c45e67c (diff) | |
| parent | 84450bb2972c00307c9eb17111df35a9316de4af (diff) | |
Merge pull request #13556 from Jxiced/master
Don't allow usernames to have leading or trailing spaces
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/UserManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/UserManager.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index c7ae0f4db..fba8923f8 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -113,7 +113,7 @@ namespace Jellyfin.Server.Implementations.Users // This is some regex that matches only on unicode "word" characters, as well as -, _ and @ // In theory this will cut out most if not all 'control' characters which should help minimize any weirdness // Usernames can contain letters (a-z + whatever else unicode is cool with), numbers (0-9), at-signs (@), dashes (-), underscores (_), apostrophes ('), periods (.) and spaces ( ) - [GeneratedRegex(@"^[\w\ \-'._@+]+$")] + [GeneratedRegex(@"^(?!\s)[\w\ \-'._@+]+(?<!\s)$")] private static partial Regex ValidUsernameRegex(); /// <inheritdoc/> |
