Be more tolerant with Xml cache document
This commit is contained in:
@@ -179,7 +179,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
|
||||
elt = null;
|
||||
var min = int.MaxValue;
|
||||
foreach (XmlElement e in xml.DocumentElement.ChildNodes)
|
||||
foreach (var e in xml.DocumentElement.ChildNodes.OfType<XmlElement>())
|
||||
{
|
||||
var sortOrder = int.Parse(e.GetAttribute("sortOrder"));
|
||||
if (sortOrder < min)
|
||||
@@ -201,7 +201,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
|
||||
if (hideTopLevelNode && startNodeId <= 0)
|
||||
{
|
||||
foreach (XmlElement e in elt.ChildNodes)
|
||||
foreach (var e in elt.ChildNodes.OfType<XmlElement>())
|
||||
{
|
||||
var id = NavigateElementRoute(e, urlParts);
|
||||
if (id > 0) return id;
|
||||
@@ -224,11 +224,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
while (found && i < urlParts.Length)
|
||||
{
|
||||
found = false;
|
||||
foreach (XmlNode childNode in elt.ChildNodes)
|
||||
foreach (var child in elt.ChildNodes.OfType<XmlElement>())
|
||||
{
|
||||
var child = childNode as XmlElement;
|
||||
if (child == null) continue; // be safe
|
||||
|
||||
var noNode = UseLegacySchema
|
||||
? child.Name != "node"
|
||||
: child.GetAttributeNode("isDoc") == null;
|
||||
|
||||
Reference in New Issue
Block a user