diff options
| author | Antony Dovgal <tony2001@php.net> | 2007-04-10 09:37:09 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2007-04-10 09:37:09 +0000 |
| commit | 562f886ecb14b7d1095a0b555b96db4b22a9c000 (patch) | |
| tree | c3a1f1ef6fe596c1a9e8294251e99ae3cbb9d43b /ext/standard/basic_functions.c | |
| parent | 08daab9d1cfd78059ef046ed98c8980c74969844 (diff) | |
| download | php-git-562f886ecb14b7d1095a0b555b96db4b22a9c000.tar.gz | |
MFH: fix #41037 (unregister_tick_function() inside the tick function crash PHP)
Diffstat (limited to 'ext/standard/basic_functions.c')
| -rw-r--r-- | ext/standard/basic_functions.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index c420805e27..d6186e618f 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5317,17 +5317,24 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_ { zval *func1 = tick_fe1->arguments[0]; zval *func2 = tick_fe2->arguments[0]; + int ret; TSRMLS_FETCH(); if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) { - return (zend_binary_zval_strcmp(func1, func2) == 0); + ret = (zend_binary_zval_strcmp(func1, func2) == 0); } else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) { zval result; zend_compare_arrays(&result, func1, func2 TSRMLS_CC); - return (Z_LVAL(result) == 0); + ret = (Z_LVAL(result) == 0); } else { + ret = 0; + } + + if (ret && tick_fe1->calling) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete tick function executed at the moment"); return 0; } + return ret; } void php_call_shutdown_functions(TSRMLS_D) |
