]> granicus.if.org Git - php/commitdiff
Check buffer status
authorYasuo Ohgaki <yohgaki@php.net>
Thu, 2 May 2002 04:04:59 +0000 (04:04 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Thu, 2 May 2002 04:04:59 +0000 (04:04 +0000)
main/output.c

index e8ffc9ee546327e8a413006bdc81ce14e3b45eba..288b7c0469295ae018fee54f70724754f8315303 100644 (file)
@@ -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;
                }