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 /log.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 'log.c')
| -rw-r--r-- | log.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -118,12 +118,12 @@ PHP_SUHOSIN_API void suhosin_log(int loglevel, char *fmt, ...) | |||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | if (SUHOSIN_G(log_use_x_forwarded_for)) { | 120 | if (SUHOSIN_G(log_use_x_forwarded_for)) { |
| 121 | ip_address = sapi_getenv("HTTP_X_FORWARDED_FOR", 20 TSRMLS_CC); | 121 | ip_address = suhosin_getenv("HTTP_X_FORWARDED_FOR", 20 TSRMLS_CC); |
| 122 | if (ip_address == NULL) { | 122 | if (ip_address == NULL) { |
| 123 | ip_address = "X-FORWARDED-FOR not set"; | 123 | ip_address = "X-FORWARDED-FOR not set"; |
| 124 | } | 124 | } |
| 125 | } else { | 125 | } else { |
| 126 | ip_address = sapi_getenv("REMOTE_ADDR", 11 TSRMLS_CC); | 126 | ip_address = suhosin_getenv("REMOTE_ADDR", 11 TSRMLS_CC); |
| 127 | if (ip_address == NULL) { | 127 | if (ip_address == NULL) { |
| 128 | ip_address = "REMOTE_ADDR not set"; | 128 | ip_address = "REMOTE_ADDR not set"; |
| 129 | } | 129 | } |
| @@ -154,7 +154,7 @@ PHP_SUHOSIN_API void suhosin_log(int loglevel, char *fmt, ...) | |||
| 154 | } | 154 | } |
| 155 | ap_php_snprintf(buf, sizeof(buf), "%s - %s (attacker '%s', file '%s', line %u)", alertstring, error, ip_address, fname, lineno); | 155 | ap_php_snprintf(buf, sizeof(buf), "%s - %s (attacker '%s', file '%s', line %u)", alertstring, error, ip_address, fname, lineno); |
| 156 | } else { | 156 | } else { |
| 157 | fname = sapi_getenv("SCRIPT_FILENAME", 15 TSRMLS_CC); | 157 | fname = suhosin_getenv("SCRIPT_FILENAME", 15 TSRMLS_CC); |
| 158 | if (fname==NULL) { | 158 | if (fname==NULL) { |
| 159 | fname = "unknown"; | 159 | fname = "unknown"; |
| 160 | } | 160 | } |
