From 8ee815ec91f42c9aa18e8cdef7c68090394a4dc5 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Thu, 2 May 2002 04:04:59 +0000 Subject: [PATCH] Check buffer status --- main/output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/output.c b/main/output.c index e8ffc9ee54..288b7c0469 100644 --- a/main/output.c +++ b/main/output.c @@ -211,7 +211,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS if (SG(headers_sent) && !SG(request_info).headers_only) { OG(php_body_write) = php_ub_body_write_no_header; } else { - if (!OG(active_ob_buffer).erase) /* Set Content-Length only if unerasable */ + /* Set Content-Length only if unerasable */ + if (!OG(active_ob_buffer).erase && status == (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_END)) ADD_CL_HEADER(OG(active_ob_buffer).text_length); OG(php_body_write) = php_ub_body_write; } -- 2.50.1