Skip to content

Commit

Permalink
ensure \ob_end_flush() while ob_get_level() > 0 before \ob_start() fo…
Browse files Browse the repository at this point in the history
…r fatal error handler declaration
  • Loading branch information
samsonasik committed Jan 17, 2019
1 parent 742891a commit 59377da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Listener/Mvc.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function phpError(MvcEvent $e) : void
\ini_set('display_errors', '0');
}

while (\ob_get_level() > 0) {
\ob_end_flush();
}

\ob_start([$this, 'phpFatalErrorHandler']);
\register_shutdown_function([$this, 'execOnShutdown']);
\set_error_handler([$this, 'phpErrorHandler']);
Expand Down
4 changes: 4 additions & 0 deletions src/Middleware/Expressive.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public function phpError() : void
\ini_set('display_errors', '0');
}

while (\ob_get_level() > 0) {
\ob_end_flush();
}

\ob_start([$this, 'phpFatalErrorHandler']);
\register_shutdown_function([$this, 'execOnShutdown']);
\set_error_handler([$this, 'phpErrorHandler']);
Expand Down

0 comments on commit 59377da

Please sign in to comment.