[wp-trac] [WordPress Trac] #36708: Silence ini_set() in wp_debug_mode() if WP_DEBUG is off
WordPress Trac
noreply at wordpress.org
Sat May 7 21:45:27 UTC 2016
#36708: Silence ini_set() in wp_debug_mode() if WP_DEBUG is off
----------------------------+--------------------
Reporter: SergeyBiryukov | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.5.3
Component: Bootstrap/Load | Version: 4.5
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+--------------------
Comment (by avagoldin):
Replying to [comment:2 adamsilverstein]:
> I agree with this suggestion: logging can be useful here to debug a
failing ajax or xml-rpc callback. Even though displaying errors breaks the
calls, it also exposes the errors more directly for developers who may not
have file/log file access. If I had WP_DEBUG true I would expect to see
errors regardless of the context.
I added a patch with a check for WP_DEBUG.
> As a side note, it would be good to check wp-api calls to see if we
follow the same logic of suppressing errors there.
{{{
if ( ! WP_DEBUG && ( defined( 'XMLRPC_REQUEST' ) || defined(
'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) ) {
@ini_set( 'display_errors', 0 );
}
}}}
'''defined( 'REST_REQUEST' )''' is in the test if it is what you mean.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36708#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list