Skip to content

Commit ee6f253

Browse files
Toby222taydeo
authored andcommitted
Sanitize input (#4798)
* Sanitize custom objective summary * Untouch
1 parent d1e7aa9 commit ee6f253

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

Content.Client/RoundEnd/RoundEndSummaryWindow.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
using System.Linq;
2727
using System.Numerics;
2828
using Content.Client.Message;
29+
using Content.Client.UserInterface.RichText; // DeltaV - Limit what tags can be used in custom objective summaries
2930
using Content.Shared.GameTicking;
3031
using Robust.Client.UserInterface.Controls;
3132
using Robust.Client.UserInterface.CustomControls;
33+
using Robust.Client.UserInterface.RichText; // DeltaV - Limit what tags can be used in custom objective summaries
3234
using Robust.Shared.Utility;
3335
using static Robust.Client.UserInterface.Controls.BoxContainer;
3436

@@ -104,7 +106,20 @@ private BoxContainer MakeRoundEndSummaryTab(string gamemode, string roundEnd, Ti
104106
if (!string.IsNullOrEmpty(roundEnd))
105107
{
106108
var roundEndLabel = new RichTextLabel();
107-
roundEndLabel.SetMarkup(roundEnd);
109+
// Begin DeltaV - Limit what tags can be used in custom objective summaries
110+
roundEndLabel.SetMessage(
111+
FormattedMessage.FromMarkupPermissive(roundEnd),
112+
[
113+
typeof(BoldItalicTag),
114+
typeof(BoldTag),
115+
typeof(BulletTag),
116+
typeof(ColorTag),
117+
typeof(HeadingTag),
118+
typeof(ItalicTag),
119+
typeof(MonoTag)
120+
]
121+
);
122+
// End DeltaV - Limit what tags can be used in custom objective summaries
108123
roundEndSummaryContainer.AddChild(roundEndLabel);
109124
}
110125

0 commit comments

Comments
 (0)