Qt/NetPlayDialog: Escape HTML in chat

This commit is contained in:
spycrab 2018-05-10 19:19:09 +02:00
parent 893c5e694e
commit 7550389c72

View File

@ -201,8 +201,8 @@ void NetPlayDialog::OnChat()
Settings::Instance().GetNetPlayClient()->SendChatMessage(msg); Settings::Instance().GetNetPlayClient()->SendChatMessage(msg);
m_chat_type_edit->clear(); m_chat_type_edit->clear();
DisplayMessage(QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname), DisplayMessage(QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname).toHtmlEscaped(),
QString::fromStdString(msg)), QString::fromStdString(msg).toHtmlEscaped()),
"blue"); "blue");
}); });
} }
@ -439,7 +439,7 @@ void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color,
void NetPlayDialog::AppendChat(const std::string& msg) void NetPlayDialog::AppendChat(const std::string& msg)
{ {
DisplayMessage(QString::fromStdString(msg), ""); DisplayMessage(QString::fromStdString(msg).toHtmlEscaped(), "");
} }
void NetPlayDialog::OnMsgChangeGame(const std::string& title) void NetPlayDialog::OnMsgChangeGame(const std::string& title)