mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-17 02:51:37 -05:00
Clean up unescaped & in feed XML
This commit is contained in:
@@ -17,10 +17,14 @@
|
|||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<SccProjectName>SAK</SccProjectName>
|
<SccProjectName>
|
||||||
<SccLocalPath>SAK</SccLocalPath>
|
</SccProjectName>
|
||||||
<SccAuxPath>SAK</SccAuxPath>
|
<SccLocalPath>
|
||||||
<SccProvider>SAK</SccProvider>
|
</SccLocalPath>
|
||||||
|
<SccAuxPath>
|
||||||
|
</SccAuxPath>
|
||||||
|
<SccProvider>
|
||||||
|
</SccProvider>
|
||||||
<PublishUrl>\\server\d\FeedCenter\</PublishUrl>
|
<PublishUrl>\\server\d\FeedCenter\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Unc</InstallFrom>
|
<InstallFrom>Unc</InstallFrom>
|
||||||
@@ -54,7 +58,7 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Common.Debug;
|
using System.Text.RegularExpressions;
|
||||||
|
using Common.Debug;
|
||||||
using Common.Xml;
|
using Common.Xml;
|
||||||
using FeedCenter.FeedParsers;
|
using FeedCenter.FeedParsers;
|
||||||
using System;
|
using System;
|
||||||
@@ -172,6 +173,10 @@ namespace FeedCenter
|
|||||||
// Clean up common invalid XML characters
|
// Clean up common invalid XML characters
|
||||||
feedText = feedText.Replace(" ", " ");
|
feedText = feedText.Replace(" ", " ");
|
||||||
|
|
||||||
|
// Find ampersands that aren't properly escaped and replace them with escaped versions
|
||||||
|
var r = new Regex("&(?!(?:[a-z]+|#[0-9]+|#x[0-9a-f]+);)");
|
||||||
|
feedText = r.Replace(feedText, "&");
|
||||||
|
|
||||||
return Tuple.Create(FeedReadResult.Success, feedText);
|
return Tuple.Create(FeedReadResult.Success, feedText);
|
||||||
}
|
}
|
||||||
catch (IOException ioException)
|
catch (IOException ioException)
|
||||||
|
|||||||
Reference in New Issue
Block a user