aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-03-15 21:40:17 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-23 21:10:46 +0100
commit807df411ae281e08d718ba76f551eabae7b6ab94 (patch)
treeb75c9cce254e4a6b9d99dc7d99ee60c40bd6e1e6 /src
parentee5c0e5372308f4a6e52b14a14f5ee6a683b58dc (diff)
Core/Channels: Limit channel length only for custom channels
(cherry picked from commit 3fb41da57c5f6aea04f8e0b02056a6313575b764)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Handlers/ChannelHandler.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp
index 435b62b9719..3f573a28a96 100644
--- a/src/server/game/Handlers/ChannelHandler.cpp
+++ b/src/server/game/Handlers/ChannelHandler.cpp
@@ -65,11 +65,11 @@ void WorldSession::HandleJoinChannel(WorldPackets::Channel::JoinChannel& packet)
if (packet.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);
+ TC_LOG_ERROR("network", "Player %s tried to create a channel with a password more than " SZFMTD " characters long - blocked", GetPlayer()->GetGUID().ToString().c_str(), MAX_CHANNEL_PASS_STR);
return;
}
- if (!ValidateHyperlinksAndMaybeKick(packet.ChannelName))
+ if (!DisallowHyperlinksAndMaybeKick(packet.ChannelName))
return;
if (ChannelMgr* cMgr = ChannelMgr::ForTeam(GetPlayer()->GetTeam()))
@@ -81,6 +81,12 @@ void WorldSession::HandleJoinChannel(WorldPackets::Channel::JoinChannel& packet)
}
else
{ // custom channel
+ if (packet.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 (Channel* channel = cMgr->GetCustomChannel(packet.ChannelName))
channel->JoinChannel(GetPlayer(), packet.Password);
else if (Channel* channel = cMgr->CreateCustomChannel(packet.ChannelName))