diff options
| author | xXx-caillou-xXx | 2018-08-20 10:50:58 +0200 |
|---|---|---|
| committer | jvoisin | 2018-08-20 08:50:58 +0000 |
| commit | 2105928a9848dac1867d681ee9e004595ea73089 (patch) | |
| tree | 04c35c637bf259c107aa4c4abb697158b0f7898f /src/snuffleupagus.c | |
| parent | d538eef4fb62174ea32d94e28f1f5a20c5094426 (diff) | |
Fix two minor issues
- Fix an infinite loop on `echo` hook
- Use the correct function to compare filenames internally
Diffstat (limited to 'src/snuffleupagus.c')
| -rw-r--r-- | src/snuffleupagus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index 3f9e1eb..ff0c6c3 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c | |||
| @@ -265,12 +265,14 @@ static PHP_INI_MH(OnUpdateConfiguration) { | |||
| 265 | // This is needed to implement the global strict mode | 265 | // This is needed to implement the global strict mode |
| 266 | CG(compiler_options) |= ZEND_COMPILE_HANDLE_OP_ARRAY; | 266 | CG(compiler_options) |= ZEND_COMPILE_HANDLE_OP_ARRAY; |
| 267 | } | 267 | } |
| 268 | if (zend_hash_str_find( | 268 | |
| 269 | // If `zend_write_default` is not NULL it is already hooked. | ||
| 270 | if ((zend_hash_str_find( | ||
| 269 | SNUFFLEUPAGUS_G(config).config_disabled_functions_hooked, "echo", | 271 | SNUFFLEUPAGUS_G(config).config_disabled_functions_hooked, "echo", |
| 270 | strlen("echo")) || | 272 | strlen("echo")) || |
| 271 | zend_hash_str_find( | 273 | zend_hash_str_find( |
| 272 | SNUFFLEUPAGUS_G(config).config_disabled_functions_ret_hooked, "echo", | 274 | SNUFFLEUPAGUS_G(config).config_disabled_functions_ret_hooked, "echo", |
| 273 | strlen("echo"))) { | 275 | strlen("echo"))) && NULL == zend_write_default) { |
| 274 | zend_write_default = zend_write; | 276 | zend_write_default = zend_write; |
| 275 | zend_write = hook_echo; | 277 | zend_write = hook_echo; |
| 276 | } | 278 | } |
