Selaa lähdekoodia

Update ThrowIfInvalidUsername to include whitespaces.

Jxiced 3 kuukautta sitten
vanhempi
sitoutus
a0ab0eb875
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Jellyfin.Server.Implementations/Users/UserManager.cs

+ 1 - 1
Jellyfin.Server.Implementations/Users/UserManager.cs

@@ -735,7 +735,7 @@ namespace Jellyfin.Server.Implementations.Users
 
 
         internal static void ThrowIfInvalidUsername(string name)
         internal static void ThrowIfInvalidUsername(string name)
         {
         {
-            if (!string.IsNullOrWhiteSpace(name) && ValidUsernameRegex().IsMatch(name))
+            if (!string.IsNullOrWhiteSpace(name) && ValidUsernameRegex().IsMatch(name) && !char.IsWhiteSpace(name[0]) && !char.IsWhiteSpace(name[^1]))
             {
             {
                 return;
                 return;
             }
             }