[mapserver-commits] r8560 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Feb 16 23:01:04 EST 2009


Author: assefa
Date: 2009-02-16 23:01:04 -0500 (Mon, 16 Feb 2009)
New Revision: 8560

Modified:
   trunk/mapserver/mapwms.c
Log:
wms 1.3.0: validate GetLegendGraphic parameters #473

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2009-02-16 18:04:25 UTC (rev 8559)
+++ trunk/mapserver/mapwms.c	2009-02-17 04:01:04 UTC (rev 8560)
@@ -3068,6 +3068,7 @@
     int i = 0;
     int nWidth = -1, nHeight =-1;
     char *pszStyle = NULL;
+    char *sld_version = NULL;
 
      for(i=0; map && i<numentries; i++)
      {
@@ -3101,6 +3102,8 @@
            psScale = values[i];
          else if (strcasecmp(names[i], "STYLE") == 0)
            pszStyle = values[i];
+         else if(strcasecmp(names[i], "SLD_VERSION") == 0) 
+           sld_version = values[i];
 #endif
      }
 
@@ -3115,6 +3118,16 @@
          return msWMSException(map, nVersion, "InvalidFormat");
      }
 
+     if (nVersion >= OWS_1_3_0 && sld_version == NULL)
+  {
+      msSetError(MS_WMSERR, "Missing required parameter SLD_VERSION", "GetLegendGraphic()");
+      return msWMSException(map, nVersion, "MissingParameterValue");
+  }
+  if (nVersion >= OWS_1_3_0 && strcasecmp(sld_version, "1.1.0") != 0)
+  {
+      msSetError(MS_WMSERR, "SLD_VERSION must be 1.1.0", "GetLegendGraphic()");
+      return msWMSException(map, nVersion, "InvalidParameterValue");
+  }
      /* check if layer name is valid. We only test the layer name and not */
      /* the group name. */
      for (i=0; i<map->numlayers; i++)



More information about the mapserver-commits mailing list