diff options
| author | Stefan Esser | 2012-01-14 19:32:14 +0100 |
|---|---|---|
| committer | Stefan Esser | 2012-01-14 19:32:14 +0100 |
| commit | 3b6c6af3faa6a66e4f5337a769baed32f404b82b (patch) | |
| tree | 54c4cfe5a6a764fe44e6faac7b3eba21bcb9059f /suhosin.c | |
| parent | 491c7e914bb972e097565d0fd40141ebb10b6107 (diff) | |
Use new suhosin_getenv() function in all places
Add protection against mbstring
Add detection of incompatible extensions that change POST handlers
Diffstat (limited to 'suhosin.c')
| -rw-r--r-- | suhosin.c | 28 |
1 files changed, 28 insertions, 0 deletions
| @@ -961,6 +961,34 @@ PHP_INI_END() | |||
| 961 | /* }}} */ | 961 | /* }}} */ |
| 962 | 962 | ||
| 963 | 963 | ||
| 964 | /* {{{ suhosin_getenv | ||
| 965 | */ | ||
| 966 | char *suhosin_getenv(char *name, size_t name_len TSRMLS_DC) | ||
| 967 | { | ||
| 968 | if (sapi_module.getenv) { | ||
| 969 | char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC); | ||
| 970 | if (tmp) { | ||
| 971 | value = estrdup(tmp); | ||
| 972 | } else { | ||
| 973 | return NULL; | ||
| 974 | } | ||
| 975 | return value; | ||
| 976 | } else { | ||
| 977 | /* fallback to the system's getenv() function */ | ||
| 978 | char *tmp; | ||
| 979 | |||
| 980 | name = estrndup(name, name_len); | ||
| 981 | tmp = getenv(name); | ||
| 982 | efree(name); | ||
| 983 | if (tmp) { | ||
| 984 | return(estrdup(tmp)); | ||
| 985 | } | ||
| 986 | } | ||
| 987 | return NULL; | ||
| 988 | } | ||
| 989 | /* }}} */ | ||
| 990 | |||
| 991 | |||
| 964 | /* {{{ suhosin_bailout | 992 | /* {{{ suhosin_bailout |
| 965 | */ | 993 | */ |
| 966 | void suhosin_bailout(TSRMLS_D) | 994 | void suhosin_bailout(TSRMLS_D) |
