From 3fa33740ed3ff2b53294c0fee766b0f567e4d19b Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Tue, 28 Jan 2025 20:40:56 +0300 Subject: [PATCH] Fix? --- .../CharacterExamine/CharacterInformationWindow.xaml.cs | 9 ++++++++- Content.Server/_White/GuideGenerator/TextTools.cs | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Content.Client/_White/CharacterExamine/CharacterInformationWindow.xaml.cs b/Content.Client/_White/CharacterExamine/CharacterInformationWindow.xaml.cs index b2a12289a7..ccecdcfccf 100644 --- a/Content.Client/_White/CharacterExamine/CharacterInformationWindow.xaml.cs +++ b/Content.Client/_White/CharacterExamine/CharacterInformationWindow.xaml.cs @@ -41,7 +41,7 @@ public sealed partial class CharacterInformationWindow : FancyWindow var unknown = Loc.GetString("generic-unknown"); // Capitalize the first letter of each word (Title Case) - unknown = string.Join(" ", unknown.Split(' ').Select(s => char.ToUpper(s[0]) + s[1..])); + unknown = string.Join(" ", unknown.Split(' ').Select(s => OopsConcat(char.ToUpper(s[0]).ToString(), s[1..]))); _name.SetMarkup(unknown); _job.SetMarkup(unknown); @@ -112,4 +112,11 @@ public sealed partial class CharacterInformationWindow : FancyWindow Margin = new Thickness(8, 8, 0, 0), }); } + + private static string OopsConcat(string a, string b) + { + // This exists to prevent Roslyn being clever and compiling something that fails sandbox checks. + return a + b; + } + } diff --git a/Content.Server/_White/GuideGenerator/TextTools.cs b/Content.Server/_White/GuideGenerator/TextTools.cs index 2e441f0567..3063d8ec2b 100644 --- a/Content.Server/_White/GuideGenerator/TextTools.cs +++ b/Content.Server/_White/GuideGenerator/TextTools.cs @@ -11,7 +11,7 @@ public sealed class TextTools { if (str.Length > 1) { - return char.ToUpper(str[0]) + str.Remove(0, 1); + return OopsConcat(char.ToUpper(str[0]).ToString(), str.Remove(0, 1)); } else if (str.Length == 1) { @@ -22,4 +22,10 @@ public sealed class TextTools return str; } } + + private static string OopsConcat(string a, string b) + { + // This exists to prevent Roslyn being clever and compiling something that fails sandbox checks. + return a + b; + } }