Skip to content

Commit ce7431f

Browse files
authored
Fix error rendering with unclosed Output buffers (joomla#41188)
1 parent 6a1a72a commit ce7431f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/src/Exception/ExceptionHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public static function render(\Throwable $error)
9494
$app->redirect('index.php');
9595
}
9696

97+
// Clear all opened Output buffers to prevent misrendering
98+
for ($i = 0, $l = ob_get_level(); $i < $l; $i++) {
99+
ob_end_clean();
100+
}
101+
97102
/*
98103
* Try and determine the format to render the error page in
99104
*

0 commit comments

Comments
 (0)