[mapserver-dev] Issue on STYLES parameter in WMS requests

Eichner, Andreas - SID-NLKM Andreas.Eichner at sid.sachsen.de
Wed Jun 20 05:18:48 PDT 2012


Hi devs,

we're using named styles and found an issue when retrieving multiple
layers. Using a request with ...&layers=a,b,c&styles=a,,&... fails with
"[...] Mapserver is expecting an empty string for the STYLES [...]".
According to the WMS spec using an empty style name in the STYLES
parameter should be treated as "default".
The problem seems to be in msWMSLoadGetMapParams() where the
msStringSplit() is used which throws empty tokens away. The following
patch solves this by using msStringSplitComplex() but I'm not sure if it
causes side effects. Would be nice if someone could have a look at it...

diff --git a/mapwms.c b/mapwms.c
index d02c667..037441b 100644
--- a/mapwms.c
+++ b/mapwms.c
@@ -1108,7 +1108,7 @@ int msWMSLoadGetMapParams(mapObj *map, int
nVersion,
       int numlayers =0;
       layerObj *lp = NULL;
 
-      tokens = msStringSplit(styles, ',' ,&n);
+      tokens = msStringSplitComplex(styles, ","
,&n,MS_ALLOWEMPTYTOKENS);
       for (i=0; i<n; i++)
       {
           if (tokens[i] && strlen(tokens[i]) > 0 && 


Greets


More information about the mapserver-dev mailing list