mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/PacketIO: Validate utf8 in every client packet
(cherry picked from commit 0a2a96efaa)
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include <utf8.h>
|
||||
#include <algorithm>
|
||||
|
||||
inline bool isNasty(uint8 c)
|
||||
@@ -73,14 +72,6 @@ inline bool ValidateMessage(Player const* player, std::string& msg)
|
||||
}
|
||||
}
|
||||
|
||||
// validate utf8
|
||||
if (!utf8::is_valid(msg.begin(), msg.end()))
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s (%s) sent a message containing an invalid UTF8 sequence - blocked", player->GetName().c_str(),
|
||||
player->GetGUID().ToString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// collapse multiple spaces into one
|
||||
if (sWorld->getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user