Skip to content

Commit

Permalink
Silently ignore WMS filter if it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ravhed committed Oct 11, 2018
1 parent d5c22cd commit 7a4280c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mapwms.c
Expand Up @@ -323,7 +323,12 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
char **paszFilters = NULL;
FilterEncodingNode *psNode = NULL;

if (!map || !filter || strlen(filter)==0)
// Empty filter should be ignored
if (!filter || strlen(filter) == 0)
return MS_SUCCESS;


if (!map)
return MS_FAILURE;

/* Count number of requested layers
Expand Down Expand Up @@ -360,7 +365,7 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
}

if (numlayers != numfilters) {
msSetError(MS_WFSERR, "Wrong number of filter elements, one filter must be specified for each requested layer.",
msSetError(MS_WMSERR, "Wrong number of filter elements, one filter must be specified for each requested layer.",
"msWMSApplyFilter" );
return msWMSException(map, version, "InvalidParameterValue", wms_exception_format);
}
Expand Down Expand Up @@ -454,7 +459,7 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
errorObj* ms_error = msGetErrorObj();

if(ms_error->code != MS_NOTFOUND) {
msSetError(MS_WFSERR, "FLTApplyFilterToLayer() failed", "msWFSGetFeature()");
msSetError(MS_WMSERR, "FLTApplyFilterToLayer() failed", "msWFSGetFeature()");
FLTFreeFilterEncodingNode( psNode );
return msWMSException(map, version, "InvalidParameterValue", wms_exception_format);
}
Expand Down

0 comments on commit 7a4280c

Please sign in to comment.