[mapserver-users] Mapserver CGI URL parameter parsing with plus character escaped as %2b

Fergus McDonald mapserver at schartz.net
Wed Oct 1 07:15:02 PDT 2014


I am having an issue with Mapserver 6.4.1 when attempting to pass a
layer labelitem parameter setting via URL.

The map file contains the following validation for layer 0

VALIDATION
	"labelitem" "[a-z]+"
END

The following request works (ignore the double quotes around the entire
URL):

"http://sitename/cgi-bin/map=pathtomapfile&mode=map&map.layer[0]=labelitem+columnname"

as does this (note the brackets replaced with html escapes)

"http://sitename/cgi-bin/map=pathtomapfile&mode=map&map.layer%5B0%5D=labelitem+columnname"

..but if the plus sign is escaped also:

"http://sitename/cgi-bin/map=pathtomapfile&mode=map&map.layer%5B0%5D=labelitem%2Bcolumnname"

Mapserver fails with the following error:

getString(): Symbol definition error. Parsing error near (+):(line 1)

This problem arises because when generating such requests from
OpenLayers, any such parameters automatically have the plus sign
escaped before the request is sent. It does seem unconsistent that
escapes are recognised for some parts of the URL and not others.

Am I doing something wrong or should this be a bug report?

Thanks in advance



More information about the MapServer-users mailing list