Fix client game crash with invite player to invalid name for Channel. (#2087)
* Fix client game crash with invite player to invalid name for Channel. https://github.com/TrinityCore/TrinityCore/commit/7b8f294c024230451f82ff67150e11fc31b61293 https://github.com/TrinityCore/TrinityCore/issues/23215 * Change `#include <utf8.h>` to `#include "utf8.h"`
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include "utf8.h"
|
||||||
|
|
||||||
void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
||||||
{
|
{
|
||||||
@@ -40,7 +41,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
|||||||
|
|
||||||
// pussywizard: restrict allowed characters in channel name to avoid |0 and possibly other exploits
|
// pussywizard: restrict allowed characters in channel name to avoid |0 and possibly other exploits
|
||||||
//if (!ObjectMgr::IsValidChannelName(channelName))
|
//if (!ObjectMgr::IsValidChannelName(channelName))
|
||||||
if (channelName.find("|") != std::string::npos || channelName.size() >= 100)
|
if (channelName.find("|") != std::string::npos || channelName.size() >= 100 || !utf8::is_valid(channelName.begin(), channelName.end()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
|
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
|
||||||
|
|||||||
Reference in New Issue
Block a user