From fa5bf4fd0bb6a855eacdb7b5eec9cd71ad9bf606 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 4 Jun 2017 20:51:56 -0700 Subject: Correct parsing of 'Media' XML element in PrimitiveBaseShape when reading an OAR file. The code used to call Serializer.ReadElementContentAsString() and then expected to pass the XML to PrimitiveBaseShape.FromXml to parse. This would throw as ReadElementContentAsString does not allow any children of the element. Reading with Serializer.ReadInnerXml() was the fix. This was only not a problem because most often shapes don't have media and most simulators don't output anything if the media array is empty. --- OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 892403b..b1b1fc5 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -1361,7 +1361,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader) { - string value = reader.ReadElementContentAsString("Media", String.Empty); + // Get inner XML and pass to MediaList parser + string value = reader.ReadInnerXml(); shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); } -- cgit v1.1