Skip to content

Commit 0b0d4de

Browse files
committed
Move WMS filter execution (GetMap) to the end of the parameter processing function - after styles are processed.
1 parent de494d0 commit 0b0d4de

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

mapwms.c

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,6 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,
994994
epsgbuf[0]='\0';
995995
srsbuffer[0]='\0';
996996

997-
998997
/* Some of the getMap parameters are actually required depending on the */
999998
/* request, but for now we assume all are optional and the map file */
1000999
/* defaults will apply. */
@@ -1035,9 +1034,6 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,
10351034
request = values[i];
10361035
}
10371036

1038-
1039-
1040-
10411037
if (strcasecmp(names[i], "LAYERS") == 0) {
10421038
int j, k, iLayer, *layerOrder;
10431039
int nLayerOrder = 0;
@@ -1153,7 +1149,6 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,
11531149
used with msLoadProjection and that does alreay the job */
11541150
/* snprintf(srsbuffer, 100, "init=epsg:%.20s", values[i]+5); */
11551151

1156-
11571152
snprintf(srsbuffer, sizeof(srsbuffer), "EPSG:%.20s",values[i]+5);
11581153
snprintf(epsgbuf, sizeof(epsgbuf), "EPSG:%.20s",values[i]+5);
11591154

@@ -1164,7 +1159,6 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,
11641159
srsbuffer[strlen(srsbuffer)-1] = '\0';
11651160
if (epsgbuf[strlen(epsgbuf)-1] == ',')
11661161
epsgbuf[strlen(epsgbuf)-1] = '\0';
1167-
11681162
}
11691163

11701164
/* we need to wait until all params are read before */
@@ -1651,29 +1645,12 @@ this request. Check wms/ows_enable_request settings.",
16511645
}
16521646
}
16531647

1654-
/*
1655-
** Apply vendor-specific filter if specified
1656-
*/
1657-
if (filter) {
1658-
if (sld_url || sld_body) {
1659-
msSetError(MS_WMSERR,
1660-
"Vendor-specific FILTER parameter cannot be used with SLD or SLD_BODY.",
1661-
"msWMSLoadGetMapParams()");
1662-
return msWMSException(map, nVersion, NULL, wms_exception_format);
1663-
}
1664-
1665-
if (msWMSApplyFilter(map, nVersion, filter, need_axis_swap, wms_exception_format) == MS_FAILURE) {
1666-
return MS_FAILURE;/* msWMSException(map, nVersion, "InvalidFilterRequest"); */
1667-
}
1668-
}
1669-
16701648
if (sld_url || sld_body) {
16711649
int nLayersBefore, nLayerAfter;
16721650
char request_tmp[32];
16731651
char *pszLayerNames = NULL;
16741652
nLayersBefore = map->numlayers;
16751653

1676-
16771654
/* -------------------------------------------------------------------- */
16781655
/* if LAYERS parameter was not given, set all layers to off */
16791656
/* -------------------------------------------------------------------- */
@@ -1684,7 +1661,6 @@ this request. Check wms/ows_enable_request settings.",
16841661
}
16851662
}
16861663

1687-
16881664
/*apply sld if defined. This is done here so that bbox and srs are already applied*/
16891665
if (sld_url) {
16901666
if ((status = msSLDApplySLDURL(map, sld_url, -1, NULL, &pszLayerNames)) != MS_SUCCESS)
@@ -1735,6 +1711,7 @@ this request. Check wms/ows_enable_request settings.",
17351711
msFree(pszLayerNames);
17361712

17371713
}
1714+
17381715
/* Validate Styles :
17391716
** MapServer advertize styles through th group setting in a class object.
17401717
** If no styles are set MapServer expects to have empty values
@@ -1910,6 +1887,22 @@ this request. Check wms/ows_enable_request settings.",
19101887

19111888
}
19121889

1890+
/*
1891+
** Apply vendor-specific filter if specified
1892+
*/
1893+
if (filter) {
1894+
if (sld_url || sld_body) {
1895+
msSetError(MS_WMSERR,
1896+
"Vendor-specific FILTER parameter cannot be used with SLD or SLD_BODY.",
1897+
"msWMSLoadGetMapParams()");
1898+
return msWMSException(map, nVersion, NULL, wms_exception_format);
1899+
}
1900+
1901+
if (msWMSApplyFilter(map, nVersion, filter, need_axis_swap, wms_exception_format) == MS_FAILURE) {
1902+
return MS_FAILURE;/* msWMSException(map, nVersion, "InvalidFilterRequest"); */
1903+
}
1904+
}
1905+
19131906
return MS_SUCCESS;
19141907
}
19151908

0 commit comments

Comments
 (0)