[wp-trac] [WordPress Trac] #46038: Exiting during the WSoD shutdown handler prevents all other shutdown handlers from being called

WordPress Trac noreply at wordpress.org
Mon Jan 21 07:14:15 UTC 2019


#46038: Exiting during the WSoD shutdown handler prevents all other shutdown
handlers from being called
-----------------------------------------------+---------------------
 Reporter:  johnbillion                        |       Owner:  (none)
     Type:  defect (bug)                       |      Status:  new
 Priority:  high                               |   Milestone:  5.1
Component:  Bootstrap/Load                     |     Version:  trunk
 Severity:  normal                             |  Resolution:
 Keywords:  servehappy has-patch dev-feedback  |     Focuses:
-----------------------------------------------+---------------------
Changes (by schlessera):

 * keywords:  needs-patch servehappy => servehappy has-patch dev-feedback


Comment:

 I uploaded a patch that adds an `'exit'` argument to `wp_die()` that
 defaults to `true` but that you can set to `false`. This allows us to
 reuse the complete response type handling (checking headers, response
 type, etc...) but just skip the `die()` at the very end. This way, all
 other shutdown handlers can still run in sequence after the WSOD
 protection.

 As this allows additional random output to be generated after the
 `wp_die()` output, I also added an open `div` tag to `display: none`
 whatever comes next. This is of course debatable, not sure whether this is
 needed, or whether this is even a good approach to hide the subsequent
 dump.

 @johnbillion Can you test whether this solves the issues with the two
 plugins you mentioned?

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


More information about the wp-trac mailing list