Fix chat sanitization and entity name escaping (#12015)

This commit is contained in:
Leon Friedrich
2022-10-18 19:59:09 +13:00
committed by GitHub
parent 6db886773b
commit 3aeba9a63e
11 changed files with 104 additions and 94 deletions

View File

@@ -24,9 +24,9 @@ namespace Content.Shared.Chat
public string Message { get; set; } = string.Empty;
/// <summary>
/// What to "wrap" the message contents with. Example is stuff like 'Joe says: "{0}"'
/// Modified message with some wrapping text. E.g. 'Joe says: "HELP!"'
/// </summary>
public string MessageWrap { get; set; } = string.Empty;
public string WrappedMessage { get; set; } = string.Empty;
/// <summary>
/// The sending entity.
@@ -46,7 +46,7 @@ namespace Content.Shared.Chat
{
Channel = (ChatChannel) buffer.ReadInt16();
Message = buffer.ReadString();
MessageWrap = buffer.ReadString();
WrappedMessage = buffer.ReadString();
switch (Channel)
{
@@ -66,7 +66,7 @@ namespace Content.Shared.Chat
{
buffer.Write((short)Channel);
buffer.Write(Message);
buffer.Write(MessageWrap);
buffer.Write(WrappedMessage);
switch (Channel)
{