Skip to content

Commit

Permalink
Merge pull request #563 from poppastring/remove-double-decode
Browse files Browse the repository at this point in the history
Rolling back the option to double decode.
  • Loading branch information
poppastring authored Apr 14, 2021
2 parents 7d38b48 + 2d0a1b4 commit 036933c
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 29 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pool:

variables:
buildConfiguration: 'Release'
version: 2.41
version: 2.42

steps:
- task: UseDotNet@2
Expand Down
2 changes: 0 additions & 2 deletions source/DasBlog.Services/ConfigFile/Interfaces/ISiteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ public interface ISiteConfig

bool CookieConsentEnabled { get; set; }

bool EnableDoubleDecode { get; set; }

[XmlAnyElement]
XmlElement[] anyElements { get; set; }

Expand Down
2 changes: 0 additions & 2 deletions source/DasBlog.Services/ConfigFile/SiteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,5 @@ public SiteConfig() { }
public string SecurityStyleSources { get; set; }

public string DefaultSources { get; set; }

public bool EnableDoubleDecode { get; set; }
}
}
2 changes: 1 addition & 1 deletion source/DasBlog.Services/DasBlog.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.0.0</Version>
<Version>3.1.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DasBlog.Web.Core\DasBlog.Core.csproj" />
Expand Down
1 change: 0 additions & 1 deletion source/DasBlog.Tests/UnitTests/SiteConfigTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public class SiteConfigTest : ISiteConfig
public string SecurityScriptSources { get; set; }

public string SecurityStyleSources { get; set; }
public bool EnableDoubleDecode { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string DefaultSources { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
}
}
2 changes: 0 additions & 2 deletions source/DasBlog.Web.UI/Config/site.Development.config
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@
<SecurityStyleSources>cloud.tinymce.com;cdn.tiny.cloud;cdn.jsdelivr.net;js.nicedit.com;www.google.com;platform.twitter.com;cdn.syndication.twimg.com;fonts.googleapis.com;maxcdn.bootstrapcdn.com</SecurityStyleSources>
<SecurityScriptSources>cloud.tinymce.com;cdn.tiny.cloud;cdn.jsdelivr.net;js.nicedit.com;www.google.com;cse.google.com;cdn.syndication.twimg.com;platform.twitter.com;apis.google.com;www.google-analytics.com;www.googletagservices.com;adservice.google.com;securepubads.g.doubleclick.net;ajax.aspnetcdn.com;ssl.google-analytics.com</SecurityScriptSources>

<EnableDoubleDecode>false</EnableDoubleDecode>

<!-- Settings below this line are not currently in use -->
<!-- _________________________________________________ -->
<CommentsAllowHtml>true</CommentsAllowHtml>
Expand Down
2 changes: 0 additions & 2 deletions source/DasBlog.Web.UI/Config/site.config
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@
<SecurityStyleSources>cloud.tinymce.com;cdn.tiny.cloud;cdn.jsdelivr.net;js.nicedit.com;www.google.com;platform.twitter.com;cdn.syndication.twimg.com;fonts.googleapis.com;maxcdn.bootstrapcdn.com</SecurityStyleSources>
<SecurityScriptSources>cloud.tinymce.com;cdn.tiny.cloud;cdn.jsdelivr.net;js.nicedit.com;www.google.com;cse.google.com;cdn.syndication.twimg.com;platform.twitter.com;apis.google.com;www.google-analytics.com;www.googletagservices.com;adservice.google.com;securepubads.g.doubleclick.net;ajax.aspnetcdn.com;ssl.google-analytics.com</SecurityScriptSources>

<EnableDoubleDecode>false</EnableDoubleDecode>

<!-- Settings below this line are not currently in use -->
<!-- _________________________________________________ -->
<CommentsAllowHtml>true</CommentsAllowHtml>
Expand Down
2 changes: 1 addition & 1 deletion source/DasBlog.Web.UI/DasBlog.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<UserSecretsId>d3583964-0aca-4de4-9521-c74cdf42f990</UserSecretsId>
<Version>2.41.0</Version>
<Version>2.42.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="9.0.0" />
Expand Down
4 changes: 0 additions & 4 deletions source/DasBlog.Web.UI/Models/AdminViewModels/SiteViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ public class SiteViewModel
[Description("Help meet some of the EU General Data Protection Regulation (GDPR) requirements")]
public bool CookieConsentEnabled { get; set; }

[DisplayName("Double decode")]
[Description("")]
public bool EnableDoubleDecode { get; set; }

[DisplayName("Default Sources (seperated by semi colon")]
[Description("")]
[StringLength(50, MinimumLength = 1, ErrorMessage = "{0} should be between 1 to 50 characters")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ public PostContentTagHelper(IDasBlogSettings dasBlogSettings)

public override void Process(TagHelperContext context, TagHelperOutput output)
{
var content = Post.Content;

if(dasBlogSettings.SiteConfiguration.EnableDoubleDecode)
{
content = HttpUtility.HtmlDecode(Post.Content);
}
var content = HttpUtility.HtmlDecode(Post.Content);

output.TagName = "div";
output.TagMode = TagMode.StartTagAndEndTag;
Expand Down
7 changes: 0 additions & 7 deletions source/DasBlog.Web.UI/Views/Admin/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,6 @@

</div>

<div class="dbc-form-check row">

@Html.LabelFor(m => @Model.SiteConfig.EnableDoubleDecode, null, new { @class = "dbc-col-form-label col-3" })
@Html.CheckBoxFor(m => @Model.SiteConfig.EnableDoubleDecode, new { @class = "dbc-form-check-input" })

</div>

<h3>Internal</h3>

<div class="dbc-form-group row">
Expand Down

0 comments on commit 036933c

Please sign in to comment.