mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core/ObjectMgr: Fix possible SQL injection for game_tele
This commit is contained in:
@@ -8040,8 +8040,11 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
|
||||
|
||||
m_GameTeleMap[new_id] = tele;
|
||||
|
||||
std::string safeName(tele.name);
|
||||
WorldDatabase.escape_string(safeName);
|
||||
|
||||
WorldDatabase.PExecute("INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (%u, %f, %f, %f, %f, %d, '%s')",
|
||||
new_id, tele.position_x, tele.position_y, tele.position_z, tele.orientation, tele.mapId, tele.name.c_str());
|
||||
new_id, tele.position_x, tele.position_y, tele.position_z, tele.orientation, tele.mapId, safeName.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user