mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
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.
7b8f294c02
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 <cctype>
|
||||
#include "utf8.h"
|
||||
|
||||
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
|
||||
//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;
|
||||
|
||||
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
|
||||
|
||||
Reference in New Issue
Block a user