Core/Chat: Disallow hyperlinks from being inserted in various guild-related freetext fields (the client already blocks this)

Port From (https://github.com/TrinityCore/TrinityCore/commit/ee5c0e5372308f4a6e52b14a14f5ee6a683b58dc)
This commit is contained in:
hondacrx
2022-01-20 16:56:00 -05:00
parent 13386aab0f
commit 169abc1531
2 changed files with 55 additions and 0 deletions
+13
View File
@@ -588,6 +588,19 @@ namespace Game
return m_muteTime <= GameTime.GetGameTime();
}
public bool DisallowHyperlinksAndMaybeKick(string str)
{
if (!str.Contains('|'))
return true;
Log.outError(LogFilter.Network, $"Player {GetPlayer().GetName()} ({GetPlayer().GetGUID()}) sent a message which illegally contained a hyperlink:\n{str}");
if (WorldConfig.GetIntValue(WorldCfg.ChatStrictLinkCheckingKick) != 0)
KickPlayer();
return false;
}
public void SendNotification(CypherStrings str, params object[] args)
{
SendNotification(Global.ObjectMgr.GetCypherString(str), args);