diff --git a/main/output.c b/main/output.c index c6ac741cab1fc..ef6be672d1c16 100644 --- a/main/output.c +++ b/main/output.c @@ -925,6 +925,10 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl ); #endif + if (handler->flags & PHP_OUTPUT_HANDLER_DISABLED) { + return PHP_OUTPUT_HANDLER_FAILURE; + } + if (php_output_lock_error(context->op)) { /* fatal error */ return PHP_OUTPUT_HANDLER_FAILURE; diff --git a/tests/output/gh15181.phpt b/tests/output/gh15181.phpt new file mode 100644 index 0000000000000..5fa5c272b3992 --- /dev/null +++ b/tests/output/gh15181.phpt @@ -0,0 +1,15 @@ +--TEST-- +Fix GH-15181 (Disabled output handler is flushed again) +--FILE-- + +===DONE=== +--EXPECT-- +===DONE===