aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorUbitUmarov2018-01-05 12:24:07 +0000
committerUbitUmarov2018-01-05 12:24:07 +0000
commit89a690c11f8c7b6bbe0b6339e79a64d1ae428aec (patch)
treeeb039c92222bf22359a20ecb5294b8ab1b2a38eb /OpenSim/Region/Framework/Scenes
parentdon't be bad Jenkins.. (diff)
downloadopensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.zip
opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.gz
opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.bz2
opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.xz
a few more xml things
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SOPVehicle.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/TerrainChannel.cs16
7 files changed, 48 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
index b8db3a9..38ab934 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
@@ -58,7 +58,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
58 58
59 using (XmlTextReader reader = new XmlTextReader(path)) 59 using (XmlTextReader reader = new XmlTextReader(path))
60 { 60 {
61 reader.DtdProcessing = DtdProcessing.Prohibit;
62 reader.XmlResolver = null;
61 XmlDocument doc = new XmlDocument(); 63 XmlDocument doc = new XmlDocument();
64 doc.XmlResolver = null;
65
62 doc.Load(reader); 66 doc.Load(reader);
63// if (doc.DocumentElement != null) 67// if (doc.DocumentElement != null)
64// { 68// {
diff --git a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
index 351eda3..22734b3 100644
--- a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
+++ b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
@@ -593,6 +593,8 @@ namespace OpenSim.Region.Framework.Scenes
593 UTF8Encoding enc = new UTF8Encoding(); 593 UTF8Encoding enc = new UTF8Encoding();
594 MemoryStream ms = new MemoryStream(enc.GetBytes(text)); 594 MemoryStream ms = new MemoryStream(enc.GetBytes(text));
595 XmlTextReader xreader = new XmlTextReader(ms); 595 XmlTextReader xreader = new XmlTextReader(ms);
596 xreader.DtdProcessing = DtdProcessing.Prohibit;
597 xreader.XmlResolver = null;
596 598
597 SOPVehicle v = new SOPVehicle(); 599 SOPVehicle v = new SOPVehicle();
598 bool error; 600 bool error;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 71c8807..84367df 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2389,7 +2389,7 @@ namespace OpenSim.Region.Framework.Scenes
2389 { 2389 {
2390 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) 2390 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
2391 { 2391 {
2392 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) 2392 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
2393 { 2393 {
2394 reader.Read(); 2394 reader.Read();
2395 bool isSingleObject = reader.Name != "CoalescedObject"; 2395 bool isSingleObject = reader.Name != "CoalescedObject";
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
index a93782e..c3bc4a0 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
@@ -133,6 +133,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
133 { 133 {
134 using (XmlTextReader reader = new XmlTextReader(sr)) 134 using (XmlTextReader reader = new XmlTextReader(sr))
135 { 135 {
136 reader.DtdProcessing = DtdProcessing.Prohibit;
137 reader.XmlResolver = null;
138
136 reader.MoveToContent(); // skip possible xml declaration 139 reader.MoveToContent(); // skip possible xml declaration
137 140
138 if (reader.Name != "CoalescedObject") 141 if (reader.Name != "CoalescedObject")
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 948c345..a2d512a 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
63 String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData); 63 String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData);
64 using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null)) 64 using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null))
65 { 65 {
66 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) 66 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
67 { 67 {
68 try 68 try
69 { 69 {
@@ -267,18 +267,29 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
267 return null; 267 return null;
268 } 268 }
269 269
270 StringReader sr = new StringReader(parts[0].OuterXml); 270 SceneObjectGroup sceneObject;
271 XmlTextReader reader = new XmlTextReader(sr); 271 using(StringReader sr = new StringReader(parts[0].OuterXml))
272 SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader)); 272 {
273 reader.Close(); 273 using(XmlTextReader reader = new XmlTextReader(sr))
274 sr.Close(); 274 {
275 reader.DtdProcessing = DtdProcessing.Prohibit;
276 reader.XmlResolver = null;
277
278 sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
279 }
280 }
275 281
276 // Then deal with the rest 282 // Then deal with the rest
283 SceneObjectPart part;
277 for (int i = 1; i < parts.Count; i++) 284 for (int i = 1; i < parts.Count; i++)
278 { 285 {
279 sr = new StringReader(parts[i].OuterXml); 286 using(StringReader sr = new StringReader(parts[i].OuterXml))
280 reader = new XmlTextReader(sr); 287 {
281 SceneObjectPart part = SceneObjectPart.FromXml(reader); 288 using(XmlTextReader reader = new XmlTextReader(sr))
289 {
290 part = SceneObjectPart.FromXml(reader);
291 }
292 }
282 293
283 int originalLinkNum = part.LinkNum; 294 int originalLinkNum = part.LinkNum;
284 295
@@ -289,8 +300,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
289 if (originalLinkNum != 0) 300 if (originalLinkNum != 0)
290 part.LinkNum = originalLinkNum; 301 part.LinkNum = originalLinkNum;
291 302
292 reader.Close();
293 sr.Close();
294 } 303 }
295 304
296 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); 305 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion");
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
index 34fdb6d..977dd73 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -49,14 +49,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
49 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) 49 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset)
50 { 50 {
51 XmlDocument doc = new XmlDocument(); 51 XmlDocument doc = new XmlDocument();
52 doc.XmlResolver=null;
52 XmlNode rootNode; 53 XmlNode rootNode;
53 54
54 if (fileName.StartsWith("http:") || File.Exists(fileName)) 55 if (fileName.StartsWith("http:") || File.Exists(fileName))
55 { 56 {
56 XmlTextReader reader = new XmlTextReader(fileName); 57 using(XmlTextReader reader = new XmlTextReader(fileName))
57 reader.WhitespaceHandling = WhitespaceHandling.None; 58 {
58 doc.Load(reader); 59 reader.WhitespaceHandling = WhitespaceHandling.None;
59 reader.Close(); 60 reader.DtdProcessing = DtdProcessing.Prohibit;
61 reader.XmlResolver = null;
62
63 doc.Load(reader);
64 }
60 rootNode = doc.FirstChild; 65 rootNode = doc.FirstChild;
61 foreach (XmlNode aPrimNode in rootNode.ChildNodes) 66 foreach (XmlNode aPrimNode in rootNode.ChildNodes)
62 { 67 {
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
index 89d78cf..1beca04 100644
--- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
+++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
@@ -196,13 +196,15 @@ namespace OpenSim.Region.Framework.Scenes
196 // ITerrainChannel.LoadFromXmlString() 196 // ITerrainChannel.LoadFromXmlString()
197 public void LoadFromXmlString(string data) 197 public void LoadFromXmlString(string data)
198 { 198 {
199 StringReader sr = new StringReader(data); 199 using(StringReader sr = new StringReader(data))
200 XmlTextReader reader = new XmlTextReader(sr); 200 {
201 reader.Read(); 201 using(XmlTextReader reader = new XmlTextReader(sr))
202 202 {
203 ReadXml(reader); 203 reader.DtdProcessing = DtdProcessing.Prohibit;
204 reader.Close(); 204 reader.XmlResolver = null;
205 sr.Close(); 205 ReadXml(reader);
206 }
207 }
206 } 208 }
207 209
208 // ITerrainChannel.Merge 210 // ITerrainChannel.Merge