File tree 2 files changed +20
-2
lines changed 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -540,7 +540,16 @@ PHP_FUNCTION(ob_start)
540
540
break ;
541
541
}
542
542
if (php_start_ob_buffer (output_handler , chunk_size )== FAILURE ) {
543
- php_error (E_WARNING , "Cannot use output buffering in output buffering display handlers" );
543
+ SLS_FETCH ();
544
+ OLS_FETCH ();
545
+
546
+ if (SG (headers_sent ) && !SG (request_info ).headers_only ) {
547
+ OG (php_body_write ) = php_ub_body_write_no_header ;
548
+ } else {
549
+ OG (php_body_write ) = php_ub_body_write ;
550
+ }
551
+ OG (nesting_level ) = 0 ;
552
+ php_error (E_ERROR , "Cannot use output buffering in output buffering display handlers" );
544
553
RETURN_FALSE ;
545
554
}
546
555
RETURN_TRUE ;
Original file line number Diff line number Diff line change @@ -540,7 +540,16 @@ PHP_FUNCTION(ob_start)
540
540
break ;
541
541
}
542
542
if (php_start_ob_buffer (output_handler , chunk_size )== FAILURE ) {
543
- php_error (E_WARNING , "Cannot use output buffering in output buffering display handlers" );
543
+ SLS_FETCH ();
544
+ OLS_FETCH ();
545
+
546
+ if (SG (headers_sent ) && !SG (request_info ).headers_only ) {
547
+ OG (php_body_write ) = php_ub_body_write_no_header ;
548
+ } else {
549
+ OG (php_body_write ) = php_ub_body_write ;
550
+ }
551
+ OG (nesting_level ) = 0 ;
552
+ php_error (E_ERROR , "Cannot use output buffering in output buffering display handlers" );
544
553
RETURN_FALSE ;
545
554
}
546
555
RETURN_TRUE ;
You can’t perform that action at this time.
0 commit comments