From a15afdb6fe38923b7acbebef4bd1e3039c20a968 Mon Sep 17 00:00:00 2001 From: filp Date: Mon, 10 Jun 2013 13:20:33 +0100 Subject: [PATCH] Fix/cherry-pic #47, possibly #58 - clear all output buffers on quit --- src/Whoops/Run.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Whoops/Run.php b/src/Whoops/Run.php index 4db7d68..1f2ddde 100644 --- a/src/Whoops/Run.php +++ b/src/Whoops/Run.php @@ -194,6 +194,13 @@ class Run // to the output, otherwise, and if the script doesn't quit, return // it so that it may be used by the caller if($this->writeToOutput()) { + // @todo Might be able to clean this up a bit better + // If we're going to quit execution, cleanup all other output + // buffers before sending our own output: + if($handlerResponse == Handler::QUIT && $this->allowQuit()) { + while (ob_get_level() > 0) ob_end_clean(); + } + echo $output; }