diff options
author | Zeev Suraski <zeev@php.net> | 2001-08-11 22:55:00 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-08-11 22:55:00 +0000 |
commit | e077c6bc286d05a8c3639c07fac9cd556f96083b (patch) | |
tree | 75389f80ef864aa449437b82ddc1d58568ffcc60 /main/output.c | |
parent | 2aca8c67ea258bfb336d1d03a04c3e086e5199ba (diff) | |
download | php-git-e077c6bc286d05a8c3639c07fac9cd556f96083b.tar.gz |
Make it possible to enable chunked output buffering without providing
an output handling function
Diffstat (limited to 'main/output.c')
-rw-r--r-- | main/output.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/main/output.c b/main/output.c index 63d9b2d8f1..d8a10cfa6d 100644 --- a/main/output.c +++ b/main/output.c @@ -482,12 +482,11 @@ static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC) Turn on Output Buffering (specifying an optional output handler). */ PHP_FUNCTION(ob_start) { - zval *output_handler; + zval *output_handler=NULL; uint chunk_size=0; switch (ZEND_NUM_ARGS()) { case 0: - output_handler = NULL; break; case 1: { zval **output_handler_p; @@ -506,9 +505,11 @@ PHP_FUNCTION(ob_start) if (zend_get_parameters_ex(2, &output_handler_p, &chunk_size_p)==FAILURE) { RETURN_FALSE; } - SEPARATE_ZVAL(output_handler_p); - output_handler = *output_handler_p; - output_handler->refcount++; + if (Z_STRLEN_PP(output_handler_p)>0) { + SEPARATE_ZVAL(output_handler_p); + output_handler = *output_handler_p; + output_handler->refcount++; + } convert_to_long_ex(chunk_size_p); chunk_size = (uint) Z_LVAL_PP(chunk_size_p); } |