Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect empty style name handling on WMS STYLES parameter #4355

Closed
aeichner opened this issue Jun 22, 2012 · 2 comments
Closed

Incorrect empty style name handling on WMS STYLES parameter #4355

aeichner opened this issue Jun 22, 2012 · 2 comments
Assignees
Milestone

Comments

@aeichner
Copy link
Contributor

According to the WMS spec using an empty style name in the STYLES parameter should be treated as "default". But using a request with ...&layers=a,b,c&styles=a,,&... fails with "[...] Mapserver is expecting an empty string for the STYLES [...]".

The problem seems to be in msWMSLoadGetMapParams() where the msStringSplit() is used which throws empty tokens away. The following patch uses msStringSplitComplex() with the ALLOWEMPTYTOKENS flag set and seems to solve that problem:

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 && 
@ghost ghost assigned aboudreault Jun 24, 2012
@sdlime
Copy link
Member

sdlime commented Jun 24, 2012

Seems a reasonable change. Alan, what do you think? Steve

@tbonfort
Copy link
Member

cc @aboudreault

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants