mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 09:42:29 +08:00
Encoding error messages for custom forms widgets.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.ContentManagement.Aspects;
|
using Orchard.ContentManagement.Aspects;
|
||||||
@@ -133,7 +134,7 @@ namespace Orchard.CustomForms.Controllers {
|
|||||||
// if custom form is inside a widget, we display the form itself
|
// if custom form is inside a widget, we display the form itself
|
||||||
if (form.ContentType == "CustomFormWidget") {
|
if (form.ContentType == "CustomFormWidget") {
|
||||||
foreach (var error in ModelState.Values.SelectMany(m => m.Errors).Select(e => e.ErrorMessage)) {
|
foreach (var error in ModelState.Values.SelectMany(m => m.Errors).Select(e => e.ErrorMessage)) {
|
||||||
Services.Notifier.Error(T(error));
|
Services.Notifier.Error(new LocalizedString(HttpUtility.HtmlEncode(error)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// save the updated editor shape into TempData to survive a redirection and keep the edited values
|
// save the updated editor shape into TempData to survive a redirection and keep the edited values
|
||||||
|
|||||||
Reference in New Issue
Block a user