[mapguide-commits] r5262 - trunk/MgDev/Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Oct 8 23:01:44 EDT 2010


Author: liuar
Date: 2010-10-09 03:01:44 +0000 (Sat, 09 Oct 2010)
New Revision: 5262

Modified:
   trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp
   trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h
   trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
Log:
Ticket #1457 Parameter QUERY_LAYERS can be null for GetFeatureInfo request

Query_layers is a mandatory parameter defined in WMS specification section 7.4.3.4. 

I added one more parameter validation in MgOgcWmsServer::ValidateGetFeatureInfoParameters() to make sure the Query_Layers parameter is not null or empty. 


Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp	2010-10-08 07:30:45 UTC (rev 5261)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsException.cpp	2010-10-09 03:01:44 UTC (rev 5262)
@@ -37,6 +37,7 @@
 CPSZ MgOgcWmsException::kpszMissingBoundingBox     = _("MissingBoundingBox");
 CPSZ MgOgcWmsException::kpszInvalidBoundingBox     = _("InvalidBoundingBox");
 CPSZ MgOgcWmsException::kpszMissingInfoFormat      = _("MissingInfoFormat");
+CPSZ MgOgcWmsException::kpszMissingQueryLayers     = _("MissingQueryLayers");
 CPSZ MgOgcWmsException::kpszMissingVersion         = _("MissingVersion");
 
 // A catch-all for the innards being really unhealthy!

Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h	2010-10-08 07:30:45 UTC (rev 5261)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsException.h	2010-10-09 03:01:44 UTC (rev 5262)
@@ -77,6 +77,7 @@
     static CPSZ kpszMissingBoundingBox;
     static CPSZ kpszInvalidBoundingBox;
     static CPSZ kpszMissingInfoFormat;
+    static CPSZ kpszMissingQueryLayers;
     static CPSZ kpszMissingVersion;
 };
 

Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp	2010-10-08 07:30:45 UTC (rev 5261)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp	2010-10-09 03:01:44 UTC (rev 5262)
@@ -86,6 +86,7 @@
 CPSZ kpszExceptionMessageInvalidImageFormat   = _("The request uses an unsupported image format. (Found FORMAT=&Request.format;)"); // Localize
 CPSZ kpszExceptionMessageMissingImageFormat   = _("The request must contain a FORMAT parameter to specify the required image format."); // Localize
 CPSZ kpszExceptionMessageMissingInfoFormat    = _("The request must contain an INFO_FORMAT parameter to specify the format of feature information (MIME type)."); // Localize
+CPSZ kpszExceptionMessageMissingQueryLayers   = _("The request must contain a QUERY_LAYERS parameter to specify one or more layers to be queried."); // Localize
 CPSZ kpszExceptionMessageInvalidInfoFormat    = _("The request uses an unsupported info format. (Found INFO_FORMAT=&Request.info_format;)"); // Localize
 CPSZ kpszExceptionMessageMissingVersion       = _("The request must contain a VERSION parameter to specify the WMS version."); // Localize
 // END LOCALIZATION
@@ -718,8 +719,14 @@
     {
         // Check that all query layers are present in the map
         CPSZ queryLayerList = RequestParameter(kpszQueryStringQueryLayers);
-        if(queryLayerList != NULL && szlen(queryLayerList) > 0)
+        if(queryLayerList == NULL || szlen(queryLayerList) == 0)
         {
+            ServiceExceptionReportResponse(MgOgcWmsException(MgOgcWmsException::kpszMissingQueryLayers,
+                                                     kpszExceptionMessageMissingQueryLayers));
+            bValid = false;
+        }
+        else
+        {
             // The LAYERS param has already been validated in ValidateMapParameters()
             CPSZ mapLayerList = RequestParameter(kpszQueryStringLayers);
             Ptr<MgStringCollection> mapLayers = MgStringCollection::ParseCollection(mapLayerList, L",");



More information about the mapguide-commits mailing list