diff options
| -rw-r--r-- | Changelog | 1 | ||||
| -rw-r--r-- | header.c | 20 |
2 files changed, 20 insertions, 1 deletions
| @@ -9,6 +9,7 @@ | |||
| 9 | - Fixed random number generator replacement error case behaviour in PHP 5.3.x | 9 | - Fixed random number generator replacement error case behaviour in PHP 5.3.x |
| 10 | - Fixed error case handling in function_exists() PHP 5.3.x | 10 | - Fixed error case handling in function_exists() PHP 5.3.x |
| 11 | - Merged changes/fixes in import_request_variables()/extract() from upstream PHP | 11 | - Merged changes/fixes in import_request_variables()/extract() from upstream PHP |
| 12 | - Fixed suhosin_header_handler to be PHP 5.3.x compatible | ||
| 12 | 13 | ||
| 13 | 2009-08-15 - 0.9.29 | 14 | 2009-08-15 - 0.9.29 |
| 14 | 15 | ||
| @@ -32,7 +32,11 @@ | |||
| 32 | #include "SAPI.h" | 32 | #include "SAPI.h" |
| 33 | #include "php_variables.h" | 33 | #include "php_variables.h" |
| 34 | 34 | ||
| 35 | #if PHP_VERSION_ID >= 50300 | ||
| 36 | static int (*orig_header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) = NULL; | ||
| 37 | #else | ||
| 35 | static int (*orig_header_handler)(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) = NULL; | 38 | static int (*orig_header_handler)(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) = NULL; |
| 39 | #endif | ||
| 36 | 40 | ||
| 37 | char *suhosin_encrypt_single_cookie(char *name, int name_len, char *value, int value_len, char *key TSRMLS_DC) | 41 | char *suhosin_encrypt_single_cookie(char *name, int name_len, char *value, int value_len, char *key TSRMLS_DC) |
| 38 | { | 42 | { |
| @@ -221,10 +225,20 @@ char *suhosin_cookie_decryptor(TSRMLS_D) | |||
| 221 | 225 | ||
| 222 | /* {{{ suhosin_header_handler | 226 | /* {{{ suhosin_header_handler |
| 223 | */ | 227 | */ |
| 228 | #if PHP_VERSION_ID >= 50300 | ||
| 229 | int suhosin_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) | ||
| 230 | #else | ||
| 224 | int suhosin_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) | 231 | int suhosin_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) |
| 232 | #endif | ||
| 225 | { | 233 | { |
| 226 | int retval = SAPI_HEADER_ADD, i; | 234 | int retval = SAPI_HEADER_ADD, i; |
| 227 | char *tmp; | 235 | char *tmp; |
| 236 | |||
| 237 | #if PHP_VERSION_ID >= 50300 | ||
| 238 | if (op != SAPI_HEADER_ADD && op != SAPI_HEADER_REPLACE) { | ||
| 239 | goto suhosin_skip_header_handling; | ||
| 240 | } | ||
| 241 | #endif | ||
| 228 | 242 | ||
| 229 | if (!SUHOSIN_G(allow_multiheader) && sapi_header && sapi_header->header) { | 243 | if (!SUHOSIN_G(allow_multiheader) && sapi_header && sapi_header->header) { |
| 230 | 244 | ||
| @@ -309,10 +323,14 @@ int suhosin_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct | |||
| 309 | sapi_header->header_len = len; | 323 | sapi_header->header_len = len; |
| 310 | } | 324 | } |
| 311 | 325 | ||
| 312 | 326 | suhosin_skip_header_handling: | |
| 313 | /* If existing call the sapi header handler */ | 327 | /* If existing call the sapi header handler */ |
| 314 | if (orig_header_handler) { | 328 | if (orig_header_handler) { |
| 329 | #if PHP_VERSION_ID >= 50300 | ||
| 330 | retval = orig_header_handler(sapi_header, op, sapi_headers TSRMLS_CC); | ||
| 331 | #else | ||
| 315 | retval = orig_header_handler(sapi_header, sapi_headers TSRMLS_CC); | 332 | retval = orig_header_handler(sapi_header, sapi_headers TSRMLS_CC); |
| 333 | #endif | ||
| 316 | } | 334 | } |
| 317 | 335 | ||
| 318 | return retval; | 336 | return retval; |
