mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Channels: Limit channel length to 31 characters
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <cctype>
|
||||
|
||||
static size_t const MAX_CHANNEL_PASS_STR = 31;
|
||||
static size_t const MAX_CHANNEL_NAME_STR = 31;
|
||||
|
||||
void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
||||
{
|
||||
@@ -56,6 +57,18 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (channelName.length() > MAX_CHANNEL_NAME_STR)
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s tried to create a channel with a name more than " SZFMTD " characters long - blocked", GetPlayer()->GetGUID().ToString().c_str(), MAX_CHANNEL_NAME_STR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.length() > MAX_CHANNEL_PASS_STR)
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s tried to create a channel with a password more that " SZFMTD " characters long - blocked", GetPlayer()->GetGUID().ToString().c_str(), MAX_CHANNEL_PASS_STR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateHyperlinksAndMaybeKick(channelName))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user