Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/php_error.php
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ public static function identifyTypeHTML( $arg, $recurseLevels=1 ) {

private $classNotFoundException;

private $clearAllBuffers;

/**
* = Options =
*
Expand Down Expand Up @@ -1229,6 +1231,8 @@ public function __construct( $options=null ) {
$this->applicationRoot = ErrorHandler::optionsPop( $options, 'application_root' , $_SERVER['DOCUMENT_ROOT'] );
$this->serverName = ErrorHandler::optionsPop( $options, 'error_reporting_off', $_SERVER['SERVER_NAME'] );

$this->clearAllBuffers = ErrorHandler::optionsPop( $options, 'clear_all_buffers', false);

/*
* Relative paths might be given for document root,
* so we make it explicit.
Expand Down Expand Up @@ -1466,6 +1470,9 @@ private function startBuffer() {
* do want it. However otherwise, it will be lost.
*/
private function discardBuffer() {
if ( $this->clearAllBuffers ) {
while( @ob_end_clean() );
}
$str = $this->bufferOutputStr;

$this->bufferOutputStr = '';
Expand Down