[wp-trac] [WordPress Trac] #44534: wp_debug_mode() does not turn off display_errors for REST requests

WordPress Trac noreply at wordpress.org
Mon Oct 15 21:55:53 UTC 2018


#44534: wp_debug_mode() does not turn off display_errors for REST requests
--------------------------+------------------------
 Reporter:  chrisl27      |       Owner:  earnjam
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  5.0
Component:  REST API      |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  rest-api
--------------------------+------------------------

Comment (by danielbachhuber):

 I tested this manually by:

 1. Adding `error_log( $undefined_variable );` to a mu-plugin.
 2. Running `jQuery.getJSON('/wp-json/');` in my browser's console.

 Without 44534.3.diff, the response is:

 {{{
 <br />
 <b>Notice</b>:  Undefined variable: undefined_variable in
 <b>/Users/danielbachhuber/projects/wordpress-develop/wp-content/mu-
 plugins/local.php</b> on line <b>3</b><br />
 {"name":"wordpress-develop", [...]
 }}}

 With 44534.3.diff, the response is a valid JSON object.

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


More information about the wp-trac mailing list