mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#18484: Encoding xml local names during export
Work Item: 18484 --HG-- branch : 1.x
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Concurrent;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Xml;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
using NHibernate;
|
using NHibernate;
|
||||||
@@ -564,7 +565,7 @@ namespace Orchard.ContentManagement {
|
|||||||
|
|
||||||
var item = importContentSession.Get(identity);
|
var item = importContentSession.Get(identity);
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
item = New(element.Name.LocalName);
|
item = New(XmlConvert.DecodeName(element.Name.LocalName));
|
||||||
if (status != null && status.Value == "Draft") {
|
if (status != null && status.Value == "Draft") {
|
||||||
Create(item, VersionOptions.Draft);
|
Create(item, VersionOptions.Draft);
|
||||||
}
|
}
|
||||||
@@ -602,7 +603,7 @@ namespace Orchard.ContentManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public XElement Export(ContentItem contentItem) {
|
public XElement Export(ContentItem contentItem) {
|
||||||
var context = new ExportContentContext(contentItem, new XElement(contentItem.ContentType));
|
var context = new ExportContentContext(contentItem, new XElement(XmlConvert.EncodeLocalName(contentItem.ContentType)));
|
||||||
|
|
||||||
foreach (var contentHandler in Handlers) {
|
foreach (var contentHandler in Handlers) {
|
||||||
contentHandler.Exporting(context);
|
contentHandler.Exporting(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user