The Free Software Media System - Server Backend & API
escape regex strings
Luis Miguel Almánzar5af374072d8f
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.csindex 89676ba7e0..09bc52df41 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs@@ -39,7 +39,7 @@ namespace MediaBrowser.MediaEncoding.Subtitlesmultiline.Add(line);}subEvent.Text = string.Join(@"\N", multiline);- subEvent.Text = Regex.Replace(subEvent.Text, "\\{(\\\\[\\w]+\\(?([\\w\\d]+,?)+\\)?)+\\}", string.Empty, RegexOptions.IgnoreCase);+ subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, "<", "<", RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, ">", ">", RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, "<(\\/?(font|b|u|i|s))((\\s+(\\w|\\w[\\w\\-]*\\w)(\\s*=\\s*(?:\\\".*?\\\"|'.*?'|[^'\\\">\\s]+))?)+\\s*|\\s*)(\\/?)>", "<$1$3$7>", RegexOptions.IgnoreCase);diff --git a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.csindex 093bf34c12..996ef1c4e2 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs@@ -39,7 +39,7 @@ namespace MediaBrowser.MediaEncoding.SubtitlessubEvent.StartPositionTicks = GetTicks(sections[headers["Start"]]);subEvent.EndPositionTicks = GetTicks(sections[headers["End"]]);subEvent.Text = string.Join(",", sections.Skip(headers["Text"]));- subEvent.Text = Regex.Replace(subEvent.Text, "\\{(\\\\[\\w]+\\(?([\\w\\d]+,?)+\\)?)+\\}", string.Empty, RegexOptions.IgnoreCase);+ subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase);subEvent.Text = Regex.Replace(subEvent.Text, @"\\N", "<br />", RegexOptions.IgnoreCase);trackInfo.TrackEvents.Add(subEvent);