summaryrefslogtreecommitdiff
path: root/main/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/output.c')
-rw-r--r--main/output.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/output.c b/main/output.c
index 88928bc62f..c55286e385 100644
--- a/main/output.c
+++ b/main/output.c
@@ -120,6 +120,12 @@ PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool
uint initial_size, block_size;
if (OG(ob_lock)) {
+ if (SG(headers_sent) && !SG(request_info).headers_only) {
+ OG(php_body_write) = php_ub_body_write_no_header;
+ } else {
+ OG(php_body_write) = php_ub_body_write;
+ }
+ OG(ob_nesting_level) = 0;
php_error_docref("ref.outcontrol" TSRMLS_CC, E_ERROR, "Cannot use output buffering in output buffering display handlers");
return FAILURE;
}