diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2006-05-10 21:19:32 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2006-05-10 21:19:32 +0000 |
commit | 4df7ab403c3cb168047ce5bb14fbaf19e078b1fa (patch) | |
tree | 4943c3378bd29f9ac2a5eb5225394d91279d1428 /main | |
parent | d76c516176ac65b45f2a424c2525c2d978e120ec (diff) | |
download | php-git-4df7ab403c3cb168047ce5bb14fbaf19e078b1fa.tar.gz |
Add input_filter hook call in getenv()
Diffstat (limited to 'main')
-rw-r--r-- | main/SAPI.c | 13 |
1 files changed, 9 insertions, 4 deletions
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) |