Skip to content

Commit

Permalink
Fix for issue dnnsoftware#5047.
Browse files Browse the repository at this point in the history
Fix for issue dnnsoftware#5047.

This will allow to optionally remove the rel attribute from privacy and terms links. Default is still "rel=nofollow" but it could now either be changed or removed entirely from the ascx file.

Unfortunately the asp.net control doesn't have a rel attribute, so we have to add it ourselves.

Added Rel attribute to Privacy and Terms class and added rel="nofollow" to privacy.ascx and terms.ascx skin file.
  • Loading branch information
Andy9999 committed Mar 20, 2022
1 parent 62b8299 commit f788a5c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions DNN Platform/Website/admin/Skins/Privacy.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public Privacy()

public string Text { get; set; }

public string CssClass { get; set; }
public string CssClass { get; set; }

public string Rel { get; set; }

protected override void OnInit(EventArgs e)
{
Expand Down Expand Up @@ -58,7 +60,6 @@ protected override void OnLoad(EventArgs e)
}

this.hypPrivacy.NavigateUrl = this.PortalSettings.PrivacyTabId == Null.NullInteger ? this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Privacy") : this._navigationManager.NavigateURL(this.PortalSettings.PrivacyTabId);
this.hypPrivacy.Attributes["rel"] = "nofollow";
}
catch (Exception exc)
{
Expand Down
4 changes: 2 additions & 2 deletions DNN Platform/Website/admin/Skins/Terms.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public Terms()
public string Text { get; set; }

public string CssClass { get; set; }

public string Rel { get; set; }

protected override void OnInit(EventArgs e)
{
Expand Down Expand Up @@ -58,8 +60,6 @@ protected override void OnLoad(EventArgs e)
}

this.hypTerms.NavigateUrl = this.PortalSettings.TermsTabId == Null.NullInteger ? this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Terms") : this._navigationManager.NavigateURL(this.PortalSettings.TermsTabId);

this.hypTerms.Attributes["rel"] = "nofollow";
}
catch (Exception exc)
{
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Website/admin/Skins/privacy.ascx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DotNetNuke.UI.Skins.Controls.Privacy" Codebehind="Privacy.ascx.cs" %>
<asp:hyperlink id="hypPrivacy" runat="server" cssclass="SkinObject" enableviewstate="False"></asp:hyperlink>
<asp:hyperlink id="hypPrivacy" runat="server" cssclass="SkinObject" enableviewstate="False" rel="nofollow"></asp:hyperlink>
2 changes: 1 addition & 1 deletion DNN Platform/Website/admin/Skins/terms.ascx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DotNetNuke.UI.Skins.Controls.Terms" Codebehind="Terms.ascx.cs" %>
<asp:hyperlink id="hypTerms" runat="server" cssclass="SkinObject" enableviewstate="False"></asp:hyperlink>
<asp:hyperlink id="hypTerms" runat="server" cssclass="SkinObject" enableviewstate="False" rel="nofollow"></asp:hyperlink>

0 comments on commit f788a5c

Please sign in to comment.