From cd9c87fdaa80d71719c10abb9bb293b314480678 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Thu, 21 Sep 2023 02:26:16 -0400 Subject: [PATCH] Sanitize line feeds --- TwitchDownloaderCore/Tools/FfmpegMetadata.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TwitchDownloaderCore/Tools/FfmpegMetadata.cs b/TwitchDownloaderCore/Tools/FfmpegMetadata.cs index 7f62fca8..2e7959b8 100644 --- a/TwitchDownloaderCore/Tools/FfmpegMetadata.cs +++ b/TwitchDownloaderCore/Tools/FfmpegMetadata.cs @@ -78,7 +78,7 @@ private static string SanitizeKeyValue(string str) return str; } - if (str.AsSpan().IndexOfAny(@"=;#\") == -1) + if (str.AsSpan().IndexOfAny(@$"=;#\{LINE_FEED}") == -1) { return str; } @@ -88,6 +88,7 @@ private static string SanitizeKeyValue(string str) .Replace(";", @"\;") .Replace("#", @"\#") .Replace(@"\", @"\\") + .Replace(LINE_FEED, $@"\{LINE_FEED}") .ToString(); } }