diff options
| -rw-r--r-- | php_suhosin7.h | 13 | ||||
| -rw-r--r-- | suhosin7.c | 14 |
2 files changed, 17 insertions, 10 deletions
diff --git a/php_suhosin7.h b/php_suhosin7.h index 5024790..cbde402 100644 --- a/php_suhosin7.h +++ b/php_suhosin7.h | |||
| @@ -37,6 +37,9 @@ extern zend_module_entry suhosin7_module_entry; | |||
| 37 | # define SUHOSIN7_API | 37 | # define SUHOSIN7_API |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #ifdef ZTS | ||
| 41 | #include "TSRM.h" | ||
| 42 | #endif | ||
| 40 | 43 | ||
| 41 | /* -------------- */ | 44 | /* -------------- */ |
| 42 | 45 | ||
| @@ -323,12 +326,12 @@ ZEND_BEGIN_MODULE_GLOBALS(suhosin7) | |||
| 323 | 326 | ||
| 324 | ZEND_END_MODULE_GLOBALS(suhosin7) | 327 | ZEND_END_MODULE_GLOBALS(suhosin7) |
| 325 | 328 | ||
| 326 | /* Always refer to the globals in your function as SUHOSIN7_G(variable). | ||
| 327 | You are encouraged to rename these macros something shorter, see | ||
| 328 | examples in any other php module directory. | ||
| 329 | */ | ||
| 330 | #define SUHOSIN7_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(suhosin7, v) | 329 | #define SUHOSIN7_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(suhosin7, v) |
| 331 | 330 | ||
| 331 | #if defined(ZTS) && defined(COMPILE_DL_SUHOSIN7) | ||
| 332 | ZEND_TSRMLS_CACHE_EXTERN(); | ||
| 333 | #endif | ||
| 334 | |||
| 332 | 335 | ||
| 333 | /* Error Constants */ | 336 | /* Error Constants */ |
| 334 | #ifndef S_MEMORY | 337 | #ifndef S_MEMORY |
| @@ -417,8 +420,6 @@ char *suhosin_strcasestr(char *haystack, char *needle) | |||
| 417 | #define suhosin_strcasestr(a, b) strcasestr(a, b) | 420 | #define suhosin_strcasestr(a, b) strcasestr(a, b) |
| 418 | #endif | 421 | #endif |
| 419 | 422 | ||
| 420 | /* {{{ suhosin_strcasestr */ | ||
| 421 | |||
| 422 | 423 | ||
| 423 | /* | 424 | /* |
| 424 | * Local variables: | 425 | * Local variables: |
| @@ -27,17 +27,14 @@ | |||
| 27 | #include "php.h" | 27 | #include "php.h" |
| 28 | #include "php_ini.h" | 28 | #include "php_ini.h" |
| 29 | #include "SAPI.h" | 29 | #include "SAPI.h" |
| 30 | #include "php_suhosin7.h" | ||
| 31 | #include "suhosin7_logo.h" | 30 | #include "suhosin7_logo.h" |
| 32 | #include "ext/standard/base64.h" | 31 | #include "ext/standard/base64.h" |
| 33 | #include "ext/standard/info.h" | 32 | #include "ext/standard/info.h" |
| 33 | #include "php_suhosin7.h" | ||
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | ZEND_DECLARE_MODULE_GLOBALS(suhosin7) | 36 | ZEND_DECLARE_MODULE_GLOBALS(suhosin7) |
| 37 | 37 | ||
| 38 | /* True global resources - no need for thread safety here */ | ||
| 39 | // static int le_suhosin7; | ||
| 40 | |||
| 41 | /* ------------------------------------------------------------------------ */ | 38 | /* ------------------------------------------------------------------------ */ |
| 42 | /* PERDIR CHECKS */ | 39 | /* PERDIR CHECKS */ |
| 43 | #define PERDIR_CHECK(lower) \ | 40 | #define PERDIR_CHECK(lower) \ |
| @@ -449,6 +446,11 @@ char *suhosin_getenv(char *name, size_t name_len) | |||
| 449 | */ | 446 | */ |
| 450 | static void php_suhosin7_init_globals(zend_suhosin7_globals *suhosin7_globals) | 447 | static void php_suhosin7_init_globals(zend_suhosin7_globals *suhosin7_globals) |
| 451 | { | 448 | { |
| 449 | SDEBUG("."); | ||
| 450 | #if defined(COMPILE_DL_SUHOSIN7) && defined(ZTS) | ||
| 451 | ZEND_TSRMLS_CACHE_UPDATE(); | ||
| 452 | #endif | ||
| 453 | |||
| 452 | memset(suhosin7_globals, 0, sizeof(zend_suhosin7_globals)); | 454 | memset(suhosin7_globals, 0, sizeof(zend_suhosin7_globals)); |
| 453 | } | 455 | } |
| 454 | /* }}} */ | 456 | /* }}} */ |
| @@ -540,6 +542,10 @@ PHP_MSHUTDOWN_FUNCTION(suhosin7) | |||
| 540 | PHP_RINIT_FUNCTION(suhosin7) | 542 | PHP_RINIT_FUNCTION(suhosin7) |
| 541 | { | 543 | { |
| 542 | SDEBUG("(RINIT)"); | 544 | SDEBUG("(RINIT)"); |
| 545 | #if defined(COMPILE_DL_SUHOSIN7) && defined(ZTS) | ||
| 546 | ZEND_TSRMLS_CACHE_UPDATE(); | ||
| 547 | #endif | ||
| 548 | |||
| 543 | SUHOSIN7_G(in_code_type) = SUHOSIN_NORMAL; | 549 | SUHOSIN7_G(in_code_type) = SUHOSIN_NORMAL; |
| 544 | SUHOSIN7_G(execution_depth) = 0; | 550 | SUHOSIN7_G(execution_depth) = 0; |
| 545 | 551 | ||
