From 3c71f466e9b582c7ca1b6f9b4be96c05e76c7c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Miguel=20Alm=C3=A1nzar?= Date: Sun, 26 May 2013 15:43:29 -0400 Subject: [PATCH] remove CDATA and html tags --- MediaBrowser.Controller/Providers/BaseItemXmlParser.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 1b7d71bae..7528c689f 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.IO; +using System.Text.RegularExpressions; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; @@ -145,7 +146,14 @@ namespace MediaBrowser.Controller.Providers case "Overview": case "Description": - item.Overview = reader.ReadInnerXml(); + var overview = reader.ReadInnerXml(); + const string cdataRegex = @"\<\!\[CDATA\[(?.*)\]\]\>"; + if (Regex.IsMatch(overview, cdataRegex)) + { + var match = Regex.Match(overview, cdataRegex); + overview = match.Groups["text"].Value; + } + item.Overview = Regex.Replace(overview, @"\<[^\>]*\>", string.Empty); break; case "TagLine":