Sanitize input (#4798)

* Sanitize custom objective summary

* Untouch
This commit is contained in:
Tobias Berger 2025-11-28 18:25:48 +00:00 committed by GitHub
parent f66d16dc5a
commit 6baef896e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 1 deletions

View File

@ -1,9 +1,11 @@
using System.Linq;
using System.Numerics;
using Content.Client.Message;
using Content.Client.UserInterface.RichText; // DeltaV - Limit what tags can be used in custom objective summaries
using Content.Shared.GameTicking;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.RichText; // DeltaV - Limit what tags can be used in custom objective summaries
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
@ -79,7 +81,20 @@ namespace Content.Client.RoundEnd
if (!string.IsNullOrEmpty(roundEnd))
{
var roundEndLabel = new RichTextLabel();
roundEndLabel.SetMarkup(roundEnd);
// Begin DeltaV - Limit what tags can be used in custom objective summaries
roundEndLabel.SetMessage(
FormattedMessage.FromMarkupPermissive(roundEnd),
[
typeof(BoldItalicTag),
typeof(BoldTag),
typeof(BulletTag),
typeof(ColorTag),
typeof(HeadingTag),
typeof(ItalicTag),
typeof(MonoTag)
]
);
// End DeltaV - Limit what tags can be used in custom objective summaries
roundEndSummaryContainer.AddChild(roundEndLabel);
}