mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixed an HTML encoding issue.
See: https://orchard.codeplex.com/discussions/582038
This commit is contained in:
@@ -7,6 +7,7 @@ using Orchard.DisplayManagement;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Framework.Elements;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Layouts.Models;
|
||||
using Orchard.Layouts.Services;
|
||||
using Orchard.Layouts.ViewModels;
|
||||
@@ -84,6 +85,7 @@ namespace Orchard.Layouts.Drivers {
|
||||
part.LayoutData = _serializer.Serialize(elementInstances);
|
||||
part.TemplateId = viewModel.LayoutEditor.TemplateId;
|
||||
part.SessionKey = viewModel.LayoutEditor.SessionKey;
|
||||
viewModel.LayoutEditor.Data = _mapper.ToEditorModel(part.LayoutData, new DescribeElementsContext {Content = part}).ToJson();
|
||||
}
|
||||
|
||||
return shapeHelper.EditorTemplate(TemplateName: "Parts.Layout", Model: viewModel, Prefix: Prefix);
|
||||
|
@@ -639,7 +639,7 @@ angular
|
||||
$scope.element.htmlUnsafe = $sce.trustAsHtml(html);
|
||||
};
|
||||
|
||||
$scope.element.setHtml($scope.element.html);
|
||||
$scope.element.setHtml(decodeURIComponent($scope.element.html.replace(/\+/g, "%20")));
|
||||
},
|
||||
templateUrl: environment.templateUrl("Content"),
|
||||
replace: true,
|
||||
|
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@
|
||||
$scope.element.htmlUnsafe = $sce.trustAsHtml(html);
|
||||
};
|
||||
|
||||
$scope.element.setHtml($scope.element.html);
|
||||
$scope.element.setHtml(decodeURIComponent($scope.element.html.replace(/\+/g, "%20")));
|
||||
},
|
||||
templateUrl: environment.templateUrl("Content"),
|
||||
replace: true,
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Layouts.Elements;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
@@ -63,10 +64,12 @@ namespace Orchard.Layouts.Services {
|
||||
public class ContentModelMap : ILayoutModelMap {
|
||||
private readonly IShapeDisplay _shapeDisplay;
|
||||
private readonly IElementDisplay _elementDisplay;
|
||||
private readonly UrlHelper _urlHelper;
|
||||
|
||||
public ContentModelMap(IShapeDisplay shapeDisplay, IElementDisplay elementDisplay) {
|
||||
public ContentModelMap(IShapeDisplay shapeDisplay, IElementDisplay elementDisplay, UrlHelper urlHelper) {
|
||||
_shapeDisplay = shapeDisplay;
|
||||
_elementDisplay = elementDisplay;
|
||||
_urlHelper = urlHelper;
|
||||
}
|
||||
|
||||
public string LayoutElementType { get { return "Content"; } }
|
||||
@@ -106,7 +109,7 @@ namespace Orchard.Layouts.Services {
|
||||
node["contentTypeLabel"] = element.Descriptor.DisplayText.Text;
|
||||
node["contentTypeClass"] = element.DisplayText.Text.HtmlClassify();
|
||||
node["contentTypeDescription"] = element.Descriptor.Description.Text;
|
||||
node["html"] = _shapeDisplay.Display(_elementDisplay.DisplayElement(element, content: describeContext.Content, displayType: "Design"));
|
||||
node["html"] = _urlHelper.Encode(_shapeDisplay.Display(_elementDisplay.DisplayElement(element, content: describeContext.Content, displayType: "Design")));
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,8 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Layouts.Models;
|
||||
|
||||
namespace Orchard.Layouts.ViewModels {
|
||||
namespace Orchard.Layouts.ViewModels {
|
||||
public class LayoutPartViewModel {
|
||||
public LayoutEditor LayoutEditor { get; set; }
|
||||
}
|
||||
|
@@ -10,7 +10,6 @@
|
||||
|
||||
var command = (string)ViewBag.Command;
|
||||
var titleFormat = (string)ViewBag.TitleFormat;
|
||||
|
||||
}
|
||||
@Html.ValidationSummary()
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("Update", "Element", new { session = Model.SessionKey, area = "Orchard.Layouts" }))) {
|
||||
|
Reference in New Issue
Block a user