mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 04:48:27 +01:00
Reduce string allocations by regex
This commit is contained in:
@@ -740,7 +740,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||
throw new ArgumentException("Usernames can contain unicode symbols, numbers (0-9), dashes (-), underscores (_), apostrophes ('), and periods (.)", nameof(name));
|
||||
}
|
||||
|
||||
private static bool IsValidUsername(string name)
|
||||
private static bool IsValidUsername(ReadOnlySpan<char> name)
|
||||
{
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user