From 4df7ab403c3cb168047ce5bb14fbaf19e078b1fa Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Wed, 10 May 2006 21:19:32 +0000 Subject: Add input_filter hook call in getenv() --- main/SAPI.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'main/SAPI.c') diff --git a/main/SAPI.c b/main/SAPI.c index 1eb457a42c..5bd12b13e9 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -25,6 +25,7 @@ #include "php.h" #include "SAPI.h" +#include "php_variables.h" #include "php_ini.h" #include "ext/standard/php_string.h" #include "ext/standard/pageinfo.h" @@ -914,11 +915,15 @@ SAPI_API struct stat *sapi_get_stat(TSRMLS_D) SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC) { - if (sapi_module.getenv) { - return sapi_module.getenv(name, name_len TSRMLS_CC); + if (sapi_module.getenv) { + char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC); + if(tmp) value = estrdup(tmp); + else return NULL; + sapi_module.input_filter(PARSE_ENV, name, &value, strlen(value), NULL TSRMLS_CC); + return value; } else { - return NULL; - } + return NULL; + } } SAPI_API int sapi_get_fd(int *fd TSRMLS_DC) -- cgit v1.2.1