Skip to content

Commit

Permalink
#6193: IHtmlFilter and TokenFilter improvements and bugfixes (fixing …
Browse files Browse the repository at this point in the history
…auto-merge) (#8790)
  • Loading branch information
BenedekFarkas committed Apr 19, 2024
1 parent cf4335e commit 0faf196
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
Expand Down Expand Up @@ -74,12 +72,12 @@ public class TextFieldDriver : ContentFieldDriver<TextField> {

if (settings.MaxLength > 0) {

var value = new HtmlString(_htmlFilters.Aggregate(field.Value, (text, filter) => filter.ProcessContent(text, settings.Flavor)))
var value = new HtmlString(_htmlFilterProcessor.ProcessFilters(field.Value, settings.Flavor, part))
.ToString().RemoveTags();

if (value.Length > settings.MaxLength) {
updater.AddModelError("Text", T("The maximum allowed length for the field {0} is {1}", T(field.DisplayName), settings.MaxLength));
}
}
}
}

Expand Down

0 comments on commit 0faf196

Please sign in to comment.