diff options
Diffstat (limited to 'OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs')
-rw-r--r-- | OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index 64de18b..1254086 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | |||
@@ -190,6 +190,9 @@ namespace OpenSim.Framework.Serialization.External | |||
190 | if (xmlData == string.Empty || homeURL == string.Empty || userService == null) | 190 | if (xmlData == string.Empty || homeURL == string.Empty || userService == null) |
191 | return xmlData; | 191 | return xmlData; |
192 | 192 | ||
193 | // Deal with bug | ||
194 | xmlData = ExternalRepresentationUtils.SanitizeXml(xmlData); | ||
195 | |||
193 | using (StringWriter sw = new StringWriter()) | 196 | using (StringWriter sw = new StringWriter()) |
194 | using (XmlTextWriter writer = new XmlTextWriter(sw)) | 197 | using (XmlTextWriter writer = new XmlTextWriter(sw)) |
195 | using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) | 198 | using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) |
@@ -364,5 +367,21 @@ namespace OpenSim.Framework.Serialization.External | |||
364 | { | 367 | { |
365 | return homeURL + "/" + uuid + ";" + name; | 368 | return homeURL + "/" + uuid + ";" + name; |
366 | } | 369 | } |
370 | |||
371 | /// <summary> | ||
372 | /// Sanitation for bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) | ||
373 | /// </summary> | ||
374 | /// <param name="xmlData"></param> | ||
375 | /// <returns></returns> | ||
376 | public static string SanitizeXml(string xmlData) | ||
377 | { | ||
378 | string fixedData = xmlData; | ||
379 | if (fixedData != null) | ||
380 | // Loop, because it may contain multiple | ||
381 | while (fixedData.Contains("xmlns:xmlns:")) | ||
382 | fixedData = fixedData.Replace("xmlns:xmlns:", "xmlns:"); | ||
383 | return fixedData; | ||
384 | } | ||
385 | |||
367 | } | 386 | } |
368 | } | 387 | } |