Skip to content

Commit

Permalink
Root URLs are including FQDN at times. Remove from path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason MacLean authored and Jason MacLean committed Feb 19, 2021
1 parent 02a1902 commit 92c4358
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public void Process(RenderContentEditorArgs args)
options.AlwaysIncludeServerUrl = false;
options.SiteResolving = true;

url += LinkManager.GetItemUrl(editingItem, options).ToLowerInvariant();
var path = LinkManager.GetItemUrl(editingItem, options).ToLowerInvariant();
path = path.Replace(url, "").Replace(":443", "").Replace(":80", "");

url += path;
}
}

Expand Down Expand Up @@ -179,11 +182,11 @@ private SiteContext GetSiteContext(Item item)

return Factory.GetSite(siteName);
}
catch(Exception ex)
catch (Exception ex)
{
Log.Error($"Sitecore.Feature.PublishedPageUrl.Pipelines.ShowPublishedPageUrl.GetSiteContext -> {ex}", this);
}
return null;
return null;
}
}
}

0 comments on commit 92c4358

Please sign in to comment.