diff options
| author | Phallacy <Dragoonmac@gmail.com> | 2019-02-13 00:33:00 -0800 |
|---|---|---|
| committer | Phallacy <Dragoonmac@gmail.com> | 2019-02-13 00:33:00 -0800 |
| commit | 77602aff889e605f8178ecf95592c0d75102e59f (patch) | |
| tree | 0db6627a1aab95d6b4710e0b4de2e8f01b87cc00 /Emby.Server.Implementations/Library/UserManager.cs | |
| parent | 1ffd443d5aaec408170eaec31923a1cbbe1bb929 (diff) | |
Minor fixes re:PR870, added null checks from PR876
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/UserManager.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index a139c4e73..b8777a480 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -217,9 +217,8 @@ namespace Emby.Server.Implementations.Library }
}
- public bool IsValidUsername(string username)
+ public static bool IsValidUsername(string username)
{
- //The old way was dumb, we should make it less dumb, lets do so.
//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
string UserNameRegex = "^[\\w-'._@]*$";
@@ -229,8 +228,7 @@ namespace Emby.Server.Implementations.Library private static bool IsValidUsernameCharacter(char i)
{
- string UserNameRegex = "^[\\w-'._@]*$";
- return Regex.IsMatch(i.ToString(), UserNameRegex);
+ return IsValidUsername(i.ToString());
}
public string MakeValidUsername(string username)
|
