Skip to content

Commit

Permalink
Fix getCapabilities on maps with no layers
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarouche committed Dec 18, 2012
1 parent 3883aba commit 96dcc8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mapows.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ int msOWSRequestIsEnabled(mapObj *map, layerObj *layer,
if (disabled) return MS_FALSE;
}

if (map && (map->numlayers > 0) && check_all_layers == MS_TRUE) {
if (map && check_all_layers == MS_TRUE) {
int i, globally_enabled = MS_FALSE;
enable_request = msOWSLookupMetadata(&map->web.metadata, namespaces, "enable_request");
globally_enabled = msOWSParseRequestMetadata(enable_request, request, &disabled);
Expand Down Expand Up @@ -357,6 +357,9 @@ int msOWSRequestIsEnabled(mapObj *map, layerObj *layer,
if (result || (!disabled && globally_enabled))
return MS_TRUE;
}

if (!disabled && globally_enabled)
return MS_TRUE;
}

return MS_FALSE;
Expand Down

0 comments on commit 96dcc8f

Please sign in to comment.