From eec3921800e3a19f210c0488d78399c210f9b9d6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 8 Jan 2018 12:00:21 +0000 Subject: [PATCH] fall back to a obsolete property since several monos in use (include our own) do not suporte the proper .net4.0 one --- OpenSim/Capabilities/LLSD.cs | 2 +- OpenSim/Framework/PhysicsInertia.cs | 2 +- OpenSim/Framework/PrimitiveBaseShape.cs | 2 +- .../Serialization/External/ExternalRepresentationUtils.cs | 2 +- .../Framework/Serialization/External/LandDataSerializer.cs | 2 +- .../Serialization/External/RegionSettingsSerializer.cs | 2 +- .../Serialization/External/UserInventoryItemSerializer.cs | 2 +- .../Framework/Servers/HttpServer/RestDeserialiseHandler.cs | 2 +- OpenSim/Framework/Servers/HttpServer/RestSessionService.cs | 4 ++-- .../Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs | 2 +- .../Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 2 +- OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | 2 +- .../CoreModules/World/Serialiser/Tests/SerialiserTests.cs | 4 ++++ .../Framework/Scenes/Animation/DefaultAvatarAnimations.cs | 2 +- OpenSim/Region/Framework/Scenes/SOPVehicle.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- .../Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | 2 +- .../Framework/Scenes/Serialization/SceneObjectSerializer.cs | 4 ++-- .../Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | 2 +- OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 2 +- .../Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 2 +- 21 files changed, 26 insertions(+), 22 deletions(-) diff --git a/OpenSim/Capabilities/LLSD.cs b/OpenSim/Capabilities/LLSD.cs index 5ed312ce90..20df8b475e 100644 --- a/OpenSim/Capabilities/LLSD.cs +++ b/OpenSim/Capabilities/LLSD.cs @@ -83,7 +83,7 @@ namespace OpenSim.Framework.Capabilities { using (XmlTextReader reader = new XmlTextReader(st)) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; reader.Read(); diff --git a/OpenSim/Framework/PhysicsInertia.cs b/OpenSim/Framework/PhysicsInertia.cs index 8a0e43e7b4..3a55f8a0d5 100644 --- a/OpenSim/Framework/PhysicsInertia.cs +++ b/OpenSim/Framework/PhysicsInertia.cs @@ -193,7 +193,7 @@ namespace OpenSim.Framework using(MemoryStream ms = new MemoryStream(enc.GetBytes(text))) using(XmlTextReader xreader = new XmlTextReader(ms)) { - xreader.DtdProcessing = DtdProcessing.Prohibit; + xreader.ProhibitDtd = true; xreader.XmlResolver = null; v = new PhysicsInertiaData(); diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 1dc8bc3625..d071b8c3d1 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -1595,7 +1595,7 @@ namespace OpenSim.Framework { using (XmlTextReader xtr = new XmlTextReader(sr)) { - xtr.DtdProcessing = DtdProcessing.Prohibit; + xtr.ProhibitDtd = true; xtr.XmlResolver = null; xtr.MoveToContent(); diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index da877a7328..2d4bdbc255 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -221,7 +221,7 @@ namespace OpenSim.Framework.Serialization.External using (StringWriter sw = new StringWriter()) using (XmlTextWriter writer = new XmlTextWriter(sw)) using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) - using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null })) + using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true, XmlResolver = null })) { TransformXml(reader, writer, sceneName, homeURL, userService, scopeID); diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index d323f45741..7e17bc0d94 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -178,7 +178,7 @@ namespace OpenSim.Framework.Serialization.External using (XmlTextReader reader = new XmlTextReader(new StringReader(serializedLandData))) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; reader.ReadStartElement("LandData"); diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index fb4f904a7a..6ff5687eda 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -63,7 +63,7 @@ namespace OpenSim.Framework.Serialization.External StringReader sr = new StringReader(serializedSettings); XmlTextReader xtr = new XmlTextReader(sr); - xtr.DtdProcessing = DtdProcessing.Prohibit; + xtr.ProhibitDtd = true; xtr.XmlResolver = null; xtr.ReadStartElement("RegionSettings"); diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index 3c511404da..f13bb2c2b9 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs @@ -202,7 +202,7 @@ namespace OpenSim.Framework.Serialization.External using (XmlTextReader reader = new XmlTextReader(new StringReader(serialization))) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; reader.ReadStartElement("InventoryItem"); diff --git a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs index fbc51d5753..7e2d909693 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs @@ -54,7 +54,7 @@ namespace OpenSim.Framework.Servers.HttpServer TRequest deserial; using (XmlTextReader xmlReader = new XmlTextReader(request)) { - xmlReader.DtdProcessing = DtdProcessing.Prohibit; + xmlReader.ProhibitDtd = true; xmlReader.XmlResolver = null; XmlSerializer deserializer = new XmlSerializer(typeof (TRequest)); diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index dc720ddaa1..1887a13bd4 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs @@ -210,7 +210,7 @@ namespace OpenSim.Framework.Servers.HttpServer { try { - xmlReader.DtdProcessing = DtdProcessing.Prohibit; + xmlReader.ProhibitDtd = true; xmlReader.XmlResolver = null; XmlSerializer deserializer = new XmlSerializer(typeof(RestSessionObject)); deserial = (RestSessionObject)deserializer.Deserialize(xmlReader); @@ -271,7 +271,7 @@ namespace OpenSim.Framework.Servers.HttpServer { try { - xmlReader.DtdProcessing = DtdProcessing.Prohibit; + xmlReader.ProhibitDtd = true; xmlReader.XmlResolver = null; XmlSerializer deserializer = new XmlSerializer(typeof(TRequest)); deserial = (TRequest)deserializer.Deserialize(xmlReader); diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs index 013b416492..eb3c115e3c 100644 --- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs @@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures { using(XmlTextReader sr = new XmlTextReader(s)) { - sr.DtdProcessing = DtdProcessing.Prohibit; + sr.ProhibitDtd = true; sr.XmlResolver = null; sr.ReadStartElement("BakedAppearance"); while(sr.LocalName == "BakedTexture") diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 63ebf866a8..78abaed097 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -1130,7 +1130,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context); - xtr.DtdProcessing = DtdProcessing.Prohibit; + xtr.ProhibitDtd = true; xtr.XmlResolver = null; // Loaded metadata will be empty if no information exists in the archive diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 92c935b173..9a19ad918b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver StringReader sr = new StringReader(xml); XmlTextReader reader = new XmlTextReader(sr); - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; reader.ReadStartElement("assets"); diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index c9e3141ccd..8ac4de121a 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs @@ -720,6 +720,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests string xml = SceneObjectSerializer.ToOriginalXmlFormat(so); XmlTextReader xtr = new XmlTextReader(new StringReader(xml)); + xtr.ProhibitDtd = true; + xtr.XmlResolver = null; xtr.ReadStartElement("SceneObjectGroup"); xtr.ReadStartElement("RootPart"); xtr.ReadStartElement("SceneObjectPart"); @@ -831,6 +833,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests string xml2 = m_serialiserModule.SerializeGroupToXml2(so, options); XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); + xtr.ProhibitDtd = true; + xtr.XmlResolver = null; xtr.ReadStartElement("SceneObjectGroup"); xtr.ReadStartElement("SceneObjectPart"); diff --git a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs index 38ab934515..e1f96a2a2a 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation using (XmlTextReader reader = new XmlTextReader(path)) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; XmlDocument doc = new XmlDocument(); doc.XmlResolver = null; diff --git a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs index 22734b3e74..0a1923a3a5 100644 --- a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs +++ b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs @@ -593,7 +593,7 @@ namespace OpenSim.Region.Framework.Scenes UTF8Encoding enc = new UTF8Encoding(); MemoryStream ms = new MemoryStream(enc.GetBytes(text)); XmlTextReader xreader = new XmlTextReader(ms); - xreader.DtdProcessing = DtdProcessing.Prohibit; + xreader.ProhibitDtd = true; xreader.XmlResolver = null; SOPVehicle v = new SOPVehicle(); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 84367df699..a3c7dbcb20 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 { using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) { - using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null })) + using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true, XmlResolver = null })) { reader.Read(); bool isSingleObject = reader.Name != "CoalescedObject"; diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index c3bc4a0da6..abcd440689 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs @@ -133,7 +133,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { using (XmlTextReader reader = new XmlTextReader(sr)) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; reader.MoveToContent(); // skip possible xml declaration diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index a2d512a0bf..2d8f3cdb36 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 String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData); using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null)) { - using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null })) + using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true, XmlResolver = null })) { try { @@ -272,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { using(XmlTextReader reader = new XmlTextReader(sr)) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader)); diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index 977dd731ed..e486580bce 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization using(XmlTextReader reader = new XmlTextReader(fileName)) { reader.WhitespaceHandling = WhitespaceHandling.None; - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; doc.Load(reader); diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index 1beca0449e..6ebe897edc 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs @@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes { using(XmlTextReader reader = new XmlTextReader(sr)) { - reader.DtdProcessing = DtdProcessing.Prohibit; + reader.ProhibitDtd = true; reader.XmlResolver = null; ReadXml(reader); } diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 08242b6a8c..a5c7d61bec 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -1148,7 +1148,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice using (Stream s = rsp.GetResponseStream()) using (XmlTextReader rdr = new XmlTextReader(s)) { - rdr.DtdProcessing = DtdProcessing.Prohibit; + rdr.ProhibitDtd = true; rdr.XmlResolver = null; doc.Load(rdr); }