diff options
Diffstat (limited to 'OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs')
-rw-r--r-- | OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index 994cede..12194ad 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | |||
@@ -36,9 +36,9 @@ using log4net; | |||
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
39 | 39 | ||
40 | namespace OpenSim.Framework.Serialization.External | 40 | namespace OpenSim.Framework.Serialization.External |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// Serialize and deserialize user inventory items as an external format. | 43 | /// Serialize and deserialize user inventory items as an external format. |
44 | /// </summary> | 44 | /// </summary> |
@@ -49,14 +49,14 @@ namespace OpenSim.Framework.Serialization.External | |||
49 | private static Dictionary<string, Action<InventoryItemBase, XmlReader>> m_InventoryItemXmlProcessors | 49 | private static Dictionary<string, Action<InventoryItemBase, XmlReader>> m_InventoryItemXmlProcessors |
50 | = new Dictionary<string, Action<InventoryItemBase, XmlReader>>(); | 50 | = new Dictionary<string, Action<InventoryItemBase, XmlReader>>(); |
51 | 51 | ||
52 | #region InventoryItemBase Processor initialization | 52 | #region InventoryItemBase Processor initialization |
53 | static UserInventoryItemSerializer() | 53 | static UserInventoryItemSerializer() |
54 | { | 54 | { |
55 | m_InventoryItemXmlProcessors.Add("Name", ProcessName); | 55 | m_InventoryItemXmlProcessors.Add("Name", ProcessName); |
56 | m_InventoryItemXmlProcessors.Add("ID", ProcessID); | 56 | m_InventoryItemXmlProcessors.Add("ID", ProcessID); |
57 | m_InventoryItemXmlProcessors.Add("InvType", ProcessInvType); | 57 | m_InventoryItemXmlProcessors.Add("InvType", ProcessInvType); |
58 | m_InventoryItemXmlProcessors.Add("CreatorUUID", ProcessCreatorUUID); | 58 | m_InventoryItemXmlProcessors.Add("CreatorUUID", ProcessCreatorUUID); |
59 | m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID); | 59 | m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID); |
60 | m_InventoryItemXmlProcessors.Add("CreatorData", ProcessCreatorData); | 60 | m_InventoryItemXmlProcessors.Add("CreatorData", ProcessCreatorData); |
61 | m_InventoryItemXmlProcessors.Add("CreationDate", ProcessCreationDate); | 61 | m_InventoryItemXmlProcessors.Add("CreationDate", ProcessCreationDate); |
62 | m_InventoryItemXmlProcessors.Add("Owner", ProcessOwner); | 62 | m_InventoryItemXmlProcessors.Add("Owner", ProcessOwner); |
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Serialization.External | |||
73 | m_InventoryItemXmlProcessors.Add("GroupID", ProcessGroupID); | 73 | m_InventoryItemXmlProcessors.Add("GroupID", ProcessGroupID); |
74 | m_InventoryItemXmlProcessors.Add("GroupOwned", ProcessGroupOwned); | 74 | m_InventoryItemXmlProcessors.Add("GroupOwned", ProcessGroupOwned); |
75 | } | 75 | } |
76 | #endregion | 76 | #endregion |
77 | 77 | ||
78 | #region InventoryItemBase Processors | 78 | #region InventoryItemBase Processors |
79 | private static void ProcessName(InventoryItemBase item, XmlReader reader) | 79 | private static void ProcessName(InventoryItemBase item, XmlReader reader) |
@@ -189,7 +189,7 @@ namespace OpenSim.Framework.Serialization.External | |||
189 | { | 189 | { |
190 | return Deserialize(Encoding.ASCII.GetString(serialization, 0, serialization.Length)); | 190 | return Deserialize(Encoding.ASCII.GetString(serialization, 0, serialization.Length)); |
191 | } | 191 | } |
192 | 192 | ||
193 | /// <summary> | 193 | /// <summary> |
194 | /// Deserialize settings | 194 | /// Deserialize settings |
195 | /// </summary> | 195 | /// </summary> |
@@ -202,6 +202,8 @@ namespace OpenSim.Framework.Serialization.External | |||
202 | 202 | ||
203 | using (XmlTextReader reader = new XmlTextReader(new StringReader(serialization))) | 203 | using (XmlTextReader reader = new XmlTextReader(new StringReader(serialization))) |
204 | { | 204 | { |
205 | reader.ProhibitDtd = true; | ||
206 | |||
205 | reader.ReadStartElement("InventoryItem"); | 207 | reader.ReadStartElement("InventoryItem"); |
206 | 208 | ||
207 | ExternalRepresentationUtils.ExecuteReadProcessors<InventoryItemBase>( | 209 | ExternalRepresentationUtils.ExecuteReadProcessors<InventoryItemBase>( |
@@ -212,8 +214,8 @@ namespace OpenSim.Framework.Serialization.External | |||
212 | 214 | ||
213 | //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); | 215 | //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); |
214 | return item; | 216 | return item; |
215 | } | 217 | } |
216 | 218 | ||
217 | public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService) | 219 | public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService) |
218 | { | 220 | { |
219 | StringWriter sw = new StringWriter(); | 221 | StringWriter sw = new StringWriter(); |
@@ -294,11 +296,11 @@ namespace OpenSim.Framework.Serialization.External | |||
294 | } | 296 | } |
295 | 297 | ||
296 | writer.WriteEndElement(); | 298 | writer.WriteEndElement(); |
297 | 299 | ||
298 | writer.Close(); | 300 | writer.Close(); |
299 | sw.Close(); | 301 | sw.Close(); |
300 | 302 | ||
301 | return sw.ToString(); | 303 | return sw.ToString(); |
302 | } | 304 | } |
303 | } | 305 | } |
304 | } | 306 | } |