]> granicus.if.org Git - php/commitdiff
Fix bug #11678
authorZeev Suraski <zeev@php.net>
Tue, 26 Jun 2001 18:30:31 +0000 (18:30 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 26 Jun 2001 18:30:31 +0000 (18:30 +0000)
ext/standard/output.c
main/output.c

index 26f95af2e4adbacaa6b44b1a836c9ce4942ba53a..cacf045a0cc4596130222ce6c096639150a33243 100644 (file)
@@ -540,7 +540,16 @@ PHP_FUNCTION(ob_start)
                        break;
        }
        if (php_start_ob_buffer(output_handler, chunk_size)==FAILURE) {
-               php_error(E_WARNING, "Cannot use output buffering in output buffering display handlers");
+               SLS_FETCH();
+               OLS_FETCH();
+
+               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(nesting_level) = 0;
+               php_error(E_ERROR, "Cannot use output buffering in output buffering display handlers");
                RETURN_FALSE;
        }
        RETURN_TRUE;
index 26f95af2e4adbacaa6b44b1a836c9ce4942ba53a..cacf045a0cc4596130222ce6c096639150a33243 100644 (file)
@@ -540,7 +540,16 @@ PHP_FUNCTION(ob_start)
                        break;
        }
        if (php_start_ob_buffer(output_handler, chunk_size)==FAILURE) {
-               php_error(E_WARNING, "Cannot use output buffering in output buffering display handlers");
+               SLS_FETCH();
+               OLS_FETCH();
+
+               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(nesting_level) = 0;
+               php_error(E_ERROR, "Cannot use output buffering in output buffering display handlers");
                RETURN_FALSE;
        }
        RETURN_TRUE;