Skip to content

Commit

Permalink
Only escape backslashes and single quotes in SanitizeKeyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
superbonaci authored Jul 24, 2024
1 parent 03264b0 commit c9fa8a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions TwitchDownloaderCore/Tools/FfmpegMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,14 @@ private static string SanitizeKeyValue(string str)
return str;
}

if (str.AsSpan().IndexOfAny(@$"=;#\{LINE_FEED}") == -1)
if (str.AsSpan().IndexOfAny(@$"\'") == -1)
{
return str;
}

return new StringBuilder(str)
.Replace("=", @"\=")
.Replace(";", @"\;")
.Replace("#", @"\#")
.Replace(@"\", @"\\")
.Replace(LINE_FEED, $@"\{LINE_FEED}")
.Replace("'", @"\'")
.ToString();
}
}
Expand Down

0 comments on commit c9fa8a0

Please sign in to comment.