[wp-trac] [WordPress Trac] #46045: Sandboxed live editing of PHP files doesn't work together with WSOD protection

WordPress Trac noreply at wordpress.org
Fri Apr 5 13:38:20 UTC 2019

#46045: Sandboxed live editing of PHP files doesn't work together with WSOD
 Reporter:  ocean90                 |       Owner:  (none)
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  5.2
Component:  Bootstrap/Load          |     Version:  trunk
 Severity:  normal                  |  Resolution:
 Keywords:  needs-patch servehappy  |     Focuses:

Comment (by ohiosierra):

 I've identified the difference for when it occurs and doesn't -> WP_DEBUG.

 When WP_DEBUG is enabled, the "doing_it_wrong" function outputs a user
 notice. Specifically, it outputs the doing it wrong notice 3 times during
 the wp_die() function.

 One of these notices becomes the error_get_last().

 When wp_finalize_scraping_edited_file_errors() tries to determine if the
 change caused a fatal error, it specifically looks at the last error only
 and sees if it is one of E_CORE_ERROR, E_COMPILE_ERROR, E_ERROR, E_PARSE,

 Since doing_it_wrong is only a user notice, it fails that check.
 wp_finalize_scraping_edited_file_errors() returns a "true" (success), the
 loopback completes, and no changes are rolled back.

 Of course, there *is* a fatal error, so the next load triggers the WSOD

 This might be worth a separate ticket to improve the
 wp_finalize_scraping_edited_file_errors function to look at all errors and
 see if any are fatal. However, for the purposes of this ticket, the only
 note is for reproducing the error and confirming resolution, make sure
 WP_DEBUG is off.

Ticket URL: <https://core.trac.wordpress.org/ticket/46045#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list