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:
parent
7d44bf25c7
commit
502d8fc14b
1 changed files with 2 additions and 1 deletions
|
|
@ -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()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue