mirror of
https://github.com/php/php-src.git
synced 2024-12-04 15:23:44 +08:00
Don't loose information if no parameters were shown.
# Noticed by Sebatian Bergmann
This commit is contained in:
parent
bca0019d43
commit
f03801bdd6
@ -264,9 +264,12 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
|
|||||||
TRACE_APPEND_KEY("function");
|
TRACE_APPEND_KEY("function");
|
||||||
TRACE_APPEND_CHR('(');
|
TRACE_APPEND_CHR('(');
|
||||||
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
|
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
|
||||||
|
int last_len = *len;
|
||||||
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
|
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
|
||||||
|
if (last_len != *len) {
|
||||||
*len -= 2; /* remove last ', ' */
|
*len -= 2; /* remove last ', ' */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TRACE_APPEND_STR(")\n");
|
TRACE_APPEND_STR(")\n");
|
||||||
return ZEND_HASH_APPLY_KEEP;
|
return ZEND_HASH_APPLY_KEEP;
|
||||||
}
|
}
|
||||||
|
@ -264,9 +264,12 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
|
|||||||
TRACE_APPEND_KEY("function");
|
TRACE_APPEND_KEY("function");
|
||||||
TRACE_APPEND_CHR('(');
|
TRACE_APPEND_CHR('(');
|
||||||
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
|
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
|
||||||
|
int last_len = *len;
|
||||||
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
|
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
|
||||||
|
if (last_len != *len) {
|
||||||
*len -= 2; /* remove last ', ' */
|
*len -= 2; /* remove last ', ' */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TRACE_APPEND_STR(")\n");
|
TRACE_APPEND_STR(")\n");
|
||||||
return ZEND_HASH_APPLY_KEEP;
|
return ZEND_HASH_APPLY_KEEP;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user