Changeset 45023
- Timestamp:
- 03/27/2019 12:15:23 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-fatal-error-handler.php
r45014 r45023 40 40 // Display the PHP error template if headers not sent. 41 41 if ( ! headers_sent() ) { 42 $this->display_error_template( );42 $this->display_error_template( $error ); 43 43 } 44 44 } catch ( Exception $e ) { … … 118 118 * 119 119 * @since 5.2.0 120 * 121 * @param array $error Error information retrieved from `error_get_last()`. 120 122 */ 121 protected function display_error_template( ) {123 protected function display_error_template( $error ) { 122 124 if ( defined( 'WP_CONTENT_DIR' ) ) { 123 125 // Load custom PHP error template, if present. … … 131 133 132 134 // Otherwise, display the default error template. 133 $this->display_default_error_template( );135 $this->display_default_error_template( $error ); 134 136 } 135 137 … … 144 146 * 145 147 * @since 5.2.0 148 * 149 * @param array $error Error information retrieved from `error_get_last()`. 146 150 */ 147 protected function display_default_error_template( ) {151 protected function display_default_error_template( $error ) { 148 152 if ( ! function_exists( '__' ) ) { 149 153 wp_load_translations_early(); … … 167 171 * 168 172 * @param string $message HTML error message to display. 173 * @param array $error Error information retrieved from `error_get_last()`. 169 174 */ 170 $message = apply_filters( 'wp_php_error_message', $message );175 $message = apply_filters( 'wp_php_error_message', $message, $error ); 171 176 172 177 /** … … 177 182 * @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a 178 183 * 'response' key, and optionally 'link_url' and 'link_text' keys. 184 * @param array $error Error information retrieved from `error_get_last()`. 179 185 */ 180 $args = apply_filters( 'wp_php_error_args', $args );186 $args = apply_filters( 'wp_php_error_args', $args, $error ); 181 187 182 $error = new WP_Error( 'internal_server_error', $message ); 188 $wp_error = new WP_Error( 'internal_server_error', $message, array( 189 'error' => $error, 190 ) ); 183 191 184 wp_die( $ error, '', $args );192 wp_die( $wp_error, '', $args ); 185 193 } 186 194 }
Note: See TracChangeset
for help on using the changeset viewer.