From f99f6818154bc1c31374dad72b605e79ee19991e Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 4 Dec 2022 22:32:44 +1300 Subject: [PATCH] Escape paper input (#12863) --- Content.Server/Paper/PaperSystem.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Content.Server/Paper/PaperSystem.cs b/Content.Server/Paper/PaperSystem.cs index 885c24c7a9..7625390587 100644 --- a/Content.Server/Paper/PaperSystem.cs +++ b/Content.Server/Paper/PaperSystem.cs @@ -9,6 +9,7 @@ using Content.Shared.Paper; using Content.Shared.Tag; using Robust.Server.GameObjects; using Robust.Shared.Player; +using Robust.Shared.Utility; using static Content.Shared.Paper.SharedPaperComponent; namespace Content.Server.Paper @@ -105,8 +106,10 @@ namespace Content.Server.Paper if (string.IsNullOrEmpty(args.Text)) return; - if (args.Text.Length + paperComp.Content.Length <= paperComp.ContentSize) - paperComp.Content += args.Text + '\n'; + var text = FormattedMessage.EscapeText(args.Text); + + if (text.Length + paperComp.Content.Length <= paperComp.ContentSize) + paperComp.Content += text + '\n'; if (TryComp(uid, out var appearance)) appearance.SetData(PaperVisuals.Status, PaperStatus.Written);