From d644387091d8ce9114bbd08c6bbfe3e6b286111b Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 30 Aug 2019 09:26:16 -0500 Subject: [PATCH] Strip out color codes and spaces when checking for min length --- SharedLibraryCore/PartialEntities/EFClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SharedLibraryCore/PartialEntities/EFClient.cs b/SharedLibraryCore/PartialEntities/EFClient.cs index 70f3356c7..e9f1c4943 100644 --- a/SharedLibraryCore/PartialEntities/EFClient.cs +++ b/SharedLibraryCore/PartialEntities/EFClient.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; +using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -449,7 +450,8 @@ namespace SharedLibraryCore.Database.Models LastConnection = DateTime.UtcNow; Connections += 1; - if (Name.Length < 3) + string strippedName = Name.StripColors(); + if (string.IsNullOrWhiteSpace(Name) || strippedName.Replace(" ", "").Length < 3) { CurrentServer.Logger.WriteDebug($"Kicking {this} because their name is too short"); Kick(loc["SERVER_KICK_MINNAME"], Utilities.IW4MAdminClient(CurrentServer));