diff --git a/MultiAdmin/Server.cs b/MultiAdmin/Server.cs index e1f1873..8157b52 100644 --- a/MultiAdmin/Server.cs +++ b/MultiAdmin/Server.cs @@ -144,7 +144,7 @@ private set // Update related variables LogDirFile = string.IsNullOrEmpty(value) || string.IsNullOrEmpty(logDir) ? null - : $"{Path.Combine(logDir, value)}_{{0}}_log_{Port}.txt"; + : $"{Path.Combine(logDir.EscapeFormat(), value)}_{{0}}_log_{Port}.txt"; lock (this) { diff --git a/MultiAdmin/Utility/StringExtensions.cs b/MultiAdmin/Utility/StringExtensions.cs index 9525521..eadb1f0 100644 --- a/MultiAdmin/Utility/StringExtensions.cs +++ b/MultiAdmin/Utility/StringExtensions.cs @@ -39,5 +39,15 @@ public static bool Equals(this string input, string value, int startIndex) return Equals(input, value, startIndex, length); } + + /// + /// Escapes this for use with + /// + /// The to escape + /// A escaped for use with + public static string EscapeFormat(this string input) + { + return input?.Replace("{", "{{").Replace("}", "}}"); + } } }