Browse Source

updated ErrorHandler to check for existing output buffers befor ob_clean

master
Anton Grebnev 13 years ago
parent
commit
3076cf0b6a
  1. 11
      exception/ErrorHandler.php

11
exception/ErrorHandler.php

@ -19,9 +19,11 @@ class ErrorHandler
static public function error_handler($errno, $errstr, $errfile, $errline) static public function error_handler($errno, $errstr, $errfile, $errline)
{ {
ob_clean();
$ob_handlers = ob_get_status();
if (!empty($ob_handlers)) {
ob_end_clean();
}
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
return false;
} }
static protected function getSource($file, $hiline) static protected function getSource($file, $hiline)
@ -71,7 +73,10 @@ class ErrorHandler
*/ */
static public function showDebug($exception) static public function showDebug($exception)
{ {
ob_clean();
$ob_handlers = ob_get_status();
if (!empty($ob_handlers)) {
ob_end_clean();
}
$class = get_class($exception); $class = get_class($exception);
$method = Env::Server('REQUEST_METHOD', ''); $method = Env::Server('REQUEST_METHOD', '');

Loading…
Cancel
Save