File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,10 @@ PHPAPI zend_result php_output_handler_start(php_output_handler *handler)
538538 HashTable * rconflicts ;
539539 php_output_handler_conflict_check_t conflict ;
540540
541+ if (!(OG (flags ) & PHP_OUTPUT_ACTIVATED )) {
542+ return FAILURE ;
543+ }
544+
541545 if (php_output_lock_error (PHP_OUTPUT_HANDLER_START ) || !handler ) {
542546 return FAILURE ;
543547 }
Original file line number Diff line number Diff line change @@ -21,4 +21,7 @@ ob_start(new Test, 1);
2121echo "trigger bug " ;
2222?>
2323--EXPECTF--
24+ %r(Notice: ob_start\(\): Failed to create buffer in [^\r\n]+ on line \d+\r?\n(\r?\n)?)+%r
25+ Notice: ob_start(): Failed to create buffer in %s on line %d
26+
2427Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line %d
Original file line number Diff line number Diff line change 1+ --TEST--
2+ ob_start(): NULL dereference when calling ob_start() in shutdown function triggered by bailout in php_output_lock_error()
3+ --FILE--
4+ <?php
5+
6+ register_shutdown_function (function () {
7+ ob_start (function ($ input ) {
8+ echo "bar " ;
9+ return strtoupper ($ input );
10+ });
11+ });
12+
13+ ob_start (function () {
14+ ob_start ();
15+ }, 1 );
16+
17+ echo "foo " ;
18+
19+ ?>
20+ --EXPECTF--
21+ Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line %d
22+
23+ Notice: ob_start(): Failed to create buffer in %s on line %d
You can’t perform that action at this time.
0 commit comments