Skip to content

Commit

Permalink
Fix too much safeguarding
Browse files Browse the repository at this point in the history
  • Loading branch information
nul800sebastiaan committed Dec 9, 2022
1 parent 13c1ad5 commit 44eddeb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions OurUmbraco.Site/Views/Partials/SeoCanonical.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
const string newDocsBaseUrl = "https://docs.umbraco.com";

var requestUrl = Request.Url.ToString();

var formsPattern = new Regex(@"\/documentation\/Add-ons\/UmbracoForms\/(.*)", RegexOptions.IgnoreCase);
var deployPattern = new Regex(@"\/documentation\/Add-ons\/Umbraco-Deploy\/(.*)", RegexOptions.IgnoreCase);
var cloudPattern = new Regex(@"\/documentation\/Umbraco-Cloud\/(.*)", RegexOptions.IgnoreCase);
Expand Down Expand Up @@ -63,14 +64,7 @@
return;
}

var firstMatchGroup = match.Groups[1]?.ToString();

if (string.IsNullOrEmpty(firstMatchGroup))
{
return;
}

var path = firstMatchGroup.ToLowerInvariant();
var path = match.Groups[1]?.ToString()?.ToLowerInvariant();

@Html.Raw($"<link rel=\"canonical\" href=\"{newDocsBaseUrl}{urlPrefix}{path}\" />");
}

0 comments on commit 44eddeb

Please sign in to comment.