[wp-trac] [WordPress Trac] #11987: Incorrect handling of WP_DEBUG_DISPLAY
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 16 14:27:15 UTC 2010
#11987: Incorrect handling of WP_DEBUG_DISPLAY
------------------------------------+---------------------------------------
Reporter: ocean90 | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+---------------------------------------
Changes (by sivel):
* keywords: WP_DEBUG => has-patch dev-feedback
Comment:
Here is the current function:
{{{
function wp_debug_mode() {
if ( WP_DEBUG ) {
if ( defined( 'E_DEPRECATED' ) )
error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
else
error_reporting( E_ALL );
if ( WP_DEBUG_DISPLAY )
ini_set( 'display_errors', 1 );
if ( WP_DEBUG_LOG ) {
ini_set( 'log_errors', 1 );
ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
}
} else {
if ( defined( 'E_RECOVERABLE_ERROR' ) )
error_reporting( E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR
| E_USER_WARNING | E_RECOVERABLE_ERROR );
else
error_reporting( E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR
| E_USER_WARNING );
}
}
}}}
You are correct, WordPress makes no attempt at disabling display_errors.
When it was written the only intention was to give people a way to enable
it when their host had it disabled. Setting to allows for you to make WP
not "force" display_errors. The intention was not to allow people to
disable it when their host explicitly had enabled it.
This came from a conversation on IRC with Ryan, in which he had
display_errors disabled in php.ini and did not want display_errors enabled
when WP_DEBUG was set to true.
If you really want the functionality to actually override php.ini and
disable display_errors when WP_DEBUG is set, that should be do able. I'll
attach a patch in a moment. Keep in mind that these settings only affect
display_errors when WP_DEBUG is enabled.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11987#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list