[wp-trac] [WordPress Trac] #45989: WSODs protection still 500 on REST API request

WordPress Trac noreply at wordpress.org
Tue Mar 19 18:22:25 UTC 2019


#45989: WSODs protection still 500 on REST API request
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  schlessera
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.2
Component:  Bootstrap/Load                       |     Version:  trunk
 Severity:  major                                |  Resolution:
 Keywords:  needs-patch servehappy needs-        |     Focuses:  multisite
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 Looking at the current patch
 [https://core.trac.wordpress.org/attachment/ticket/45989/45989.5.diff
 45989.5.diff] I really don't like the solution. The patch as is currently
 standard relays on putting `define( 'WP_EXECUTION_SUCCEEDED', true );` on
 every point that WordPress exits execution. This is a extremely brittle,
 as if there are any places that I have missed where wordpress exits, the
 error message may show. Also any plugins and themes also exit with putting
 `define( 'WP_EXECUTION_SUCCEEDED', true );`, the error may display.

 I believe a better solution would be check if `header_sent` and if the
 last error was fatal error, display the fatal error message using
 `wp_die`. Headers sent, means that much more of core can be error handled.
 Many plugins hook into `template_redirect`, `rest_api_init` or
 `pre_get_posts`, this is where the fatal error may happen and this
 wouldn't be handle by the current solution.

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


More information about the wp-trac mailing list