General: Display fatal error handler notice in admin backend even if headers have been sent.

This ensures that at least for the admin, which is more predictable than the frontend, the user-friendlier error notice from the fatal error handler still shows if a runtime fatal error happens within the page generation process.

Props axaak.
Fixes #46811.


git-svn-id: https://develop.svn.wordpress.org/trunk@45210 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz 2019-04-16 04:37:46 +00:00
parent 5895974f10
commit 2f8a683fdc

View File

@ -42,7 +42,7 @@ class WP_Fatal_Error_Handler {
} }
// Display the PHP error template if headers not sent. // Display the PHP error template if headers not sent.
if ( ! headers_sent() ) { if ( is_admin() || ! headers_sent() ) {
$this->display_error_template( $error ); $this->display_error_template( $error );
} }
} catch ( Exception $e ) { } catch ( Exception $e ) {