[mapguide-commits] r9951 - trunk/MgDev/Server/src/Services/Mapping

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Jul 20 07:55:30 PDT 2022


Author: jng
Date: 2022-07-20 07:55:29 -0700 (Wed, 20 Jul 2022)
New Revision: 9951

Modified:
   trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
Log:
Ensure the following elements are XML-encoded in the CREATERUNTIMEMAP response:

 - Layer Names/Labels
 - Group Names/Labels
 - Feature source resource ids
 - Layer definition resource ids
 - Feature Source class name
 - Feature Source geometry property

Fixes #2846

Modified: trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2022-06-23 12:55:35 UTC (rev 9950)
+++ trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2022-07-20 14:55:29 UTC (rev 9951)
@@ -1569,7 +1569,7 @@
     STRING groupName = group->GetName();
     xml.append("<Group>\n");
     xml.append("<Name>");
-    xml.append(MgUtil::WideCharToMultiByte(groupName));
+    xml.append(MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(groupName)));
     xml.append("</Name>\n");
     xml.append("<Type>");
     INT32 gType = group->GetLayerGroupType();
@@ -1612,7 +1612,7 @@
 
     xml.append("<Layer>\n");
     xml.append("<Name>");
-    xml.append(MgUtil::WideCharToMultiByte(layer->GetName()));
+    xml.append(MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(layer->GetName())));
     xml.append("</Name>\n");
     xml.append("<Type>");
     std::string sLayerType;
@@ -1649,7 +1649,7 @@
     xml.append("<LayerDefinition>");
     Ptr<MgResourceIdentifier> layerDefId = layer->GetLayerDefinition();
     STRING ldfId = layerDefId->ToString();
-    xml.append(MgUtil::WideCharToMultiByte(ldfId));
+    xml.append(MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(ldfId)));
     xml.append("</LayerDefinition>\n");
     // ----------------------- Optional things if requested ------------------------- //
     if ((requestedFeatures & REQUEST_LAYER_FEATURE_SOURCE) == REQUEST_LAYER_FEATURE_SOURCE)
@@ -1656,13 +1656,13 @@
     {
         xml.append("<FeatureSource>\n");
         xml.append("<ResourceId>");
-        xml.append(MgUtil::WideCharToMultiByte(layer->GetFeatureSourceId()));
+        xml.append(MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(layer->GetFeatureSourceId())));
         xml.append("</ResourceId>\n");
         xml.append("<ClassName>");
-        xml.append(MgUtil::WideCharToMultiByte(layer->GetFeatureClassName()));
+        xml.append(MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(layer->GetFeatureClassName())));
         xml.append("</ClassName>\n");
         xml.append("<Geometry>");
-        xml.append(MgUtil::WideCharToMultiByte(layer->GetFeatureGeometryName()));
+        xml.append(MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(layer->GetFeatureGeometryName())));
         xml.append("</Geometry>\n");
         xml.append("</FeatureSource>\n");
     }



More information about the mapguide-commits mailing list