Skip to content

Commit

Permalink
Disable DTD processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jevgenijsp committed Dec 9, 2024
1 parent a80cc6d commit a2e7987
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Geta.NotFoundHandler/Core/Redirects/RedirectsXmlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ public RedirectsXmlParser(ILogger<RedirectsXmlParser> logger)
public CustomRedirectCollection LoadFromStream(Stream xmlContent)
{
_customRedirectsXmlFile = new XmlDocument();

if (xmlContent != null)
{
_customRedirectsXmlFile.Load(xmlContent);
var settings = new XmlReaderSettings
{
DtdProcessing = DtdProcessing.Prohibit,
XmlResolver = null
};

using var reader = XmlReader.Create(xmlContent, settings);
_customRedirectsXmlFile.Load(reader);
}
else
{
Expand Down

0 comments on commit a2e7987

Please sign in to comment.