Permalink
Browse files

SOS: make sure that ows_srs/sos_srs is of the form EPSG: before compa…

…ring to query parameter srsName
  • Loading branch information...
1 parent 791ca40 commit 701ad3c980a3dbab8e12d9075358fbbe8521f8fc @rouault rouault committed Jul 13, 2013
Showing with 4 additions and 3 deletions.
  1. +3 −2 mapogcsos.c
  2. +1 −1 msautotest
View
@@ -2127,13 +2127,14 @@ this request. Check sos/ows_enable_request settings.", "msSOSGetObservation()",
if (tokens && n > 0) {
for (k=0; k<n; k++) {
- if (strcasecmp(sosparams->pszSrsName, tokens[k]) == 0) { /* match */
+ if (strncasecmp(tokens[k], "EPSG:", strlen("EPSG:")) == 0 &&
+ strcasecmp(sosparams->pszSrsName, tokens[k]) == 0) { /* match */
bFound = 1;
/* project MAP.EXTENT to this SRS */
msInitProjection(&po);
- snprintf(srsbuffer, sizeof(srsbuffer), "+init=epsg:%.20s", sosparams->pszSrsName+5);
+ snprintf(srsbuffer, sizeof(srsbuffer), "+init=epsg:%.20s", sosparams->pszSrsName+strlen("EPSG:"));
if (msLoadProjectionString(&po, srsbuffer) != 0) {
msSetError(MS_SOSERR, "Could not set output projection to \"%s\"", "msSOSGetObservation()", sosparams->pszSrsName);

0 comments on commit 701ad3c

Please sign in to comment.