[wp-trac] [WordPress Trac] #45933: WSODs protection returns incorrect content type

WordPress Trac noreply at wordpress.org
Wed Jan 16 15:05:31 UTC 2019


#45933: WSODs protection returns incorrect content type
----------------------------------+------------------------
 Reporter:  spacedmonkey          |       Owner:  flixos90
     Type:  defect (bug)          |      Status:  reviewing
 Priority:  normal                |   Milestone:  5.1
Component:  Bootstrap/Load        |     Version:  trunk
 Severity:  normal                |  Resolution:
 Keywords:  servehappy has-patch  |     Focuses:  multisite
----------------------------------+------------------------

Comment (by flixos90):

 [attachment:"45933.4.diff"] simplifies the previous patches a bit while
 following the same approach. Most importantly it includes these changes:

 * Get rid of supporting `WP_Error` objects in the JSON `wp_die()` handler,
 and thus simplify its code significantly. Only the default handler
 supports them, so it is not actually safe passing `WP_Error` objects, and
 in our case does not provide any benefits.
 * Instead of tying in with the `back_link` argument of `wp_die()`, rely on
 new arguments `link_url` and `link_text`. Our use-case does not actually
 use a "back link", so using that naming would be confusing. Furthermore,
 with new arguments there is no risk whatsoever about backward-
 compatibility breaks.
 * Simplify the logic in `WP_Shutdown_Handler` a bit, with a new
 `display_default_error_template()` making it easy to override individual
 pieces. Since `wp_die()` is in `wp-includes/functions.php`, a new check is
 in place, preventing a potential fatal error early in the loading process.
 Filters to modify the `wp_die()` parameters are introduced with
 `wp_php_error_message` and `wp_php_error_args`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45933#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list