diff options
author | Marcus Boerger <helly@php.net> | 2003-08-31 12:40:29 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-08-31 12:40:29 +0000 |
commit | f9ee319152b012aa292ae548bb1ecfdfc9ce1876 (patch) | |
tree | d6a332c5f14983f5b6e9be016385c0e16145ff76 /Zend/zend_default_classes.c | |
parent | f1b80b9210d8f7bdd0f026714a3fd93de1f2af82 (diff) | |
download | php-git-f9ee319152b012aa292ae548bb1ecfdfc9ce1876.tar.gz |
Excluded chars < 32 when displaying string parameters that would obliterate output.
Diffstat (limited to 'Zend/zend_default_classes.c')
-rw-r--r-- | Zend/zend_default_classes.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index a57ab4a2d2..db4617bf6e 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -161,16 +161,26 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k case IS_NULL: TRACE_APPEND_STR("NULL, "); break; - case IS_STRING: + case IS_STRING: { + int l_added; TRACE_APPEND_CHR('\''); if (Z_STRLEN_PP(arg) > 15) { TRACE_APPEND_STRL(Z_STRVAL_PP(arg), 15); TRACE_APPEND_STR("...', "); + l_added = 15 + 6 + 1; /* +1 because of while (--l_added) */ } else { - TRACE_APPEND_STRL(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg)); + l_added = Z_STRLEN_PP(arg); + TRACE_APPEND_STRL(Z_STRVAL_PP(arg), l_added); TRACE_APPEND_STR("', "); + l_added += 3 + 1; + } + while (--l_added) { + if ((*str)[*len - l_added] < 32) { + (*str)[*len - l_added] = '?'; + } } break; + } case IS_BOOL: if (Z_LVAL_PP(arg)) { TRACE_APPEND_STR("true, "); |