diff --git a/src/wp-includes/class-wp-fatal-error-handler.php b/src/wp-includes/class-wp-fatal-error-handler.php
index e44dfed598..5e99a8433d 100644
|
a
|
b
|
class WP_Fatal_Error_Handler { |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Display the PHP error template. |
| 46 | | $this->display_error_template(); |
| | 46 | $this->display_error_template( $error ); |
| 47 | 47 | } catch ( Exception $e ) { |
| 48 | 48 | // Catch exceptions and remain silent. |
| 49 | 49 | } |
| … |
… |
class WP_Fatal_Error_Handler { |
| 120 | 120 | * If no such drop-in is available, this will call {@see WP_Fatal_Error_Handler::display_default_error_template()}. |
| 121 | 121 | * |
| 122 | 122 | * @since 5.2.0 |
| | 123 | * |
| | 124 | * @param array $error Error information retrieved from `error_get_last()`. |
| 123 | 125 | */ |
| 124 | | protected function display_error_template() { |
| | 126 | protected function display_error_template( $error ) { |
| 125 | 127 | if ( defined( 'WP_CONTENT_DIR' ) ) { |
| 126 | 128 | // Load custom PHP error template, if present. |
| 127 | 129 | $php_error_pluggable = WP_CONTENT_DIR . '/php-error.php'; |
| … |
… |
class WP_Fatal_Error_Handler { |
| 133 | 135 | } |
| 134 | 136 | |
| 135 | 137 | // Otherwise, display the default error template. |
| 136 | | $this->display_default_error_template(); |
| | 138 | $this->display_default_error_template( $error ); |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | 141 | /** |
| … |
… |
class WP_Fatal_Error_Handler { |
| 146 | 148 | * be used to modify these parameters. |
| 147 | 149 | * |
| 148 | 150 | * @since 5.2.0 |
| | 151 | * |
| | 152 | * @param array $error Error information retrieved from `error_get_last()`. |
| 149 | 153 | */ |
| 150 | | protected function display_default_error_template() { |
| | 154 | protected function display_default_error_template( $error ) { |
| 151 | 155 | if ( ! function_exists( '__' ) ) { |
| 152 | 156 | wp_load_translations_early(); |
| 153 | 157 | } |
| … |
… |
class WP_Fatal_Error_Handler { |
| 169 | 173 | * @since 5.2.0 |
| 170 | 174 | * |
| 171 | 175 | * @param string $message HTML error message to display. |
| | 176 | * @param array $error Error information retrieved from `error_get_last()`. |
| 172 | 177 | */ |
| 173 | | $message = apply_filters( 'wp_php_error_message', $message ); |
| | 178 | $message = apply_filters( 'wp_php_error_message', $message, $error ); |
| 174 | 179 | |
| 175 | 180 | /** |
| 176 | 181 | * Filters the arguments passed to {@see wp_die()} for the default PHP error template. |
| … |
… |
class WP_Fatal_Error_Handler { |
| 179 | 184 | * |
| 180 | 185 | * @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a |
| 181 | 186 | * 'response' key, and optionally 'link_url' and 'link_text' keys. |
| | 187 | * @param array $error Error information retrieved from `error_get_last()`. |
| 182 | 188 | */ |
| 183 | | $args = apply_filters( 'wp_php_error_args', $args ); |
| | 189 | $args = apply_filters( 'wp_php_error_args', $args, $error ); |
| 184 | 190 | |
| 185 | | $error = new WP_Error( 'internal_server_error', $message ); |
| | 191 | $wp_error = new WP_Error( 'internal_server_error', $message, array( |
| | 192 | 'error' => $error, |
| | 193 | ) ); |
| 186 | 194 | |
| 187 | | wp_die( $error, '', $args ); |
| | 195 | wp_die( $wp_error, '', $args ); |
| 188 | 196 | } |
| 189 | 197 | } |