diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index d380f5a0..c52f3217 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.4.1.1222")] -[assembly: AssemblyFileVersion("3.4.1.1222")] \ No newline at end of file +[assembly: AssemblyVersion("3.4.1.1223")] +[assembly: AssemblyFileVersion("3.4.1.1223")] \ No newline at end of file diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 9f597025..ba5053b2 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -468,6 +468,7 @@ namespace TShockAPI { foo = foo.Replace("%map%", Main.worldName); foo = foo.Replace("%players%", GetPlayers()); + foo = SanitizeString(foo); if (foo.Substring(0, 1) == "%" && foo.Substring(12, 1) == "%") //Look for a beginning color code. { string possibleColor = foo.Substring(0, 13); @@ -611,5 +612,16 @@ namespace TShockAPI } return 1000; } + + public string SanitizeString(string str) + { + var returnstr = str.ToCharArray(); + for (int i = 0; i < str.Length; i++) + { + if (!ValidString(str[i].ToString())) + returnstr[i] = ' '; + } + return returnstr.ToString(); + } } }