Skip to content

Commit

Permalink
Fix Sitemap timestamp format (OrchardCMS#15229)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored and urbanit committed Mar 18, 2024
1 parent 7d6073c commit a279fe1
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
Expand Down Expand Up @@ -74,15 +73,15 @@ private async Task<bool> BuildUrlsetMetadataAsync(ContentTypesSitemapSource sour

private async Task<bool> BuildExtendedMetadataAsync(SitemapBuilderContext context, ContentItemsQueryContext queryContext, ContentItem contentItem, XElement url)
{
var suceeded = true;
var succeeded = true;
foreach (var sc in _sitemapContentItemExtendedMetadataProviders)
{
if (!await sc.ApplyExtendedMetadataAsync(context, queryContext, contentItem, url))
{
suceeded = false;
succeeded = false;
}
}
return suceeded;
return succeeded;
}

private async Task<bool> BuildUrlAsync(SitemapBuilderContext context, ContentItem contentItem, XElement url)
Expand Down Expand Up @@ -162,7 +161,7 @@ private static void PopulateLastMod(ContentItem contentItem, XElement url)
if (contentItem.ModifiedUtc.HasValue)
{
var lastMod = new XElement(_namespace + "lastmod");
lastMod.Add(contentItem.ModifiedUtc.GetValueOrDefault().ToString("yyyy-MM-ddTHH:mm:sszzz"));
lastMod.Add(contentItem.ModifiedUtc.GetValueOrDefault().ToString("yyyy-MM-ddTHH:mm:sszzz", CultureInfo.InvariantCulture));
url.Add(lastMod);
}
}
Expand Down

0 comments on commit a279fe1

Please sign in to comment.