diff --git a/etc/mapserver-sample.conf b/etc/mapserver-sample.conf index 778d782a00..acd2855794 100644 --- a/etc/mapserver-sample.conf +++ b/etc/mapserver-sample.conf @@ -21,9 +21,10 @@ CONFIG # MS_ERRORFILE "/opt/mapserver/logs/mapserver.log" # - # Global Error Redirect Handling (see web object docs) + # Global Error Redirect Handling # - # MS_EMPTY "https://mapserver.org/" + # see https://mapserver.org/mapfile/web.html#EMPTY + # MS_EMPTY_URL "https://mapserver.org/" # # Default Map diff --git a/msautotest/query/6907_01.conf b/msautotest/query/6907_01.conf index ba79b5f104..a90b9e0553 100644 --- a/msautotest/query/6907_01.conf +++ b/msautotest/query/6907_01.conf @@ -1,6 +1,6 @@ CONFIG ENV MS_MAP_PATTERN "." - MS_EMPTY "http://localhost/6907_01.html" + MS_EMPTY_URL "http://localhost/6907_01.html" END END diff --git a/src/mapservutil.c b/src/mapservutil.c index d17a1c938f..781f931e6c 100644 --- a/src/mapservutil.c +++ b/src/mapservutil.c @@ -91,10 +91,10 @@ void msCGIWriteError(mapservObj *mapserv) { if ((ms_error->code == MS_NOTFOUND) && (mapserv->map->web.empty != NULL || - CPLGetConfigOption("MS_EMPTY", NULL) != NULL)) { + CPLGetConfigOption("MS_EMPTY_URL", NULL) != NULL)) { const char *url = mapserv->map->web.empty; if (url == NULL) - url = CPLGetConfigOption("MS_EMPTY", NULL); + url = CPLGetConfigOption("MS_EMPTY_URL", NULL); if (msReturnURL(mapserv, url, BROWSE) != MS_SUCCESS) { msIO_setHeader("Content-Type", "text/html"); msIO_sendHeaders(); @@ -2000,7 +2000,7 @@ int msCGIDispatchQueryRequest(mapservObj *mapserv) { /* catch empty result set when web->empty is set (#6907) */ if (mapserv->map->web.empty != NULL || - CPLGetConfigOption("MS_EMPTY", NULL) != NULL) { + CPLGetConfigOption("MS_EMPTY_URL", NULL) != NULL) { int n = 0; for (int i = 0; i < mapserv->map->numlayers; i++) { // count results if (mapserv->map->layers[i]->resultcache) { diff --git a/src/maptemplate.c b/src/maptemplate.c index ff2c3bc1d8..7a5fb8ac35 100644 --- a/src/maptemplate.c +++ b/src/maptemplate.c @@ -4702,7 +4702,7 @@ int msReturnPage(mapservObj *mapserv, char *html, int mode, return MS_SUCCESS; } -int msReturnURL(mapservObj *ms, char *url, int mode) { +int msReturnURL(mapservObj *ms, const char *url, int mode) { char *tmpurl; if (url == NULL) { diff --git a/src/maptemplate.h b/src/maptemplate.h index 5eea717880..887b829c3b 100644 --- a/src/maptemplate.h +++ b/src/maptemplate.h @@ -198,7 +198,7 @@ MS_DLL_EXPORT int checkWebScale(mapservObj *msObj); MS_DLL_EXPORT int setExtent(mapservObj *msObj); MS_DLL_EXPORT int msReturnPage(mapservObj *msObj, char *, int, char **); -MS_DLL_EXPORT int msReturnURL(mapservObj *msObj, char *, int); +MS_DLL_EXPORT int msReturnURL(mapservObj *msObj, const char *, int); MS_DLL_EXPORT int msReturnNestedTemplateQuery(mapservObj *msObj, char *pszMimeType, char **papszBuffer);