summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArnaud Le Blanc <lbarnaud@php.net>2008-08-18 04:09:38 +0000
committerArnaud Le Blanc <lbarnaud@php.net>2008-08-18 04:09:38 +0000
commit6f44413558a9f78b083be36971fc11bb406f8586 (patch)
treeba5d1a9141dde9f0a282080046c33e182c2dd80b /main
parent6d8afbca872b95594c80a01c4e02c92e5d2b35b1 (diff)
downloadphp-git-6f44413558a9f78b083be36971fc11bb406f8586.tar.gz
MFH: Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit).
Diffstat (limited to 'main')
-rw-r--r--main/output.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/output.c b/main/output.c
index 0b86131939..4b1aa37cb1 100644
--- a/main/output.c
+++ b/main/output.c
@@ -336,7 +336,13 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC)
{
while (OG(ob_nesting_level)!=0) {
- php_end_ob_buffer(send_buffer, 0 TSRMLS_CC);
+ /* in case of unclean_shutdown, do not output the buffer if it is not
+ * meant to be until end of script or ob_end_*() call */
+ if (CG(unclean_shutdown) && !OG(active_ob_buffer).chunk_size) {
+ php_end_ob_buffer(0, 0 TSRMLS_CC);
+ } else {
+ php_end_ob_buffer(send_buffer, 0 TSRMLS_CC);
+ }
}
}
/* }}} */