Make WordPress Core

Ticket #34074: 34074.patch

File 34074.patch, 2.5 KB (added by jrf, 9 years ago)
  • src/wp-includes/load.php

    From 613966f0a630cfd1add350b498b827acf0f717da Mon Sep 17 00:00:00 2001
    From: jrfnl <github_nospam@adviesenzo.nl>
    Date: Thu, 10 Dec 2015 01:52:05 +0100
    Subject: [PATCH] Turn error display off when WP_DEBUG is `false`.
    
    And general boyscouting the touched function.
    ---
     src/wp-includes/load.php | 28 ++++++++++++++++------------
     1 file changed, 16 insertions(+), 12 deletions(-)
    
    diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
    index 9d247ba..174aa9c 100644
    a b function timer_stop( $display = 0, $precision = 3 ) { 
    267267 * It is strongly recommended that plugin and theme developers use `WP_DEBUG`
    268268 * in their development environments.
    269269 *
    270  * `WP_DEBUG_DISPLAY` and `WP_DEBUG_LOG` perform no function unless `WP_DEBUG`
    271  * is true.
     270 * When `WP_DEBUG` is `true` *and* `WP_DEBUG_DISPLAY` is true, WordPress will
     271 * force errors to be displayed.
     272 * When `WP_DEBUG` is `false`, WordPress will turn the display of errors off.
     273 * Defining `WP_DEBUG_DISPLAY` as `null` prevents WordPress from changing the
     274 * global configuration setting in both cases.
    272275 *
    273  * When `WP_DEBUG_DISPLAY` is true, WordPress will force errors to be displayed.
    274  * `WP_DEBUG_DISPLAY` defaults to true. Defining it as null prevents WordPress
    275  * from changing the global configuration setting. Defining `WP_DEBUG_DISPLAY`
    276  * as false will force errors to be hidden.
    277  *
    278  * When `WP_DEBUG_LOG` is true, errors will be logged to debug.log in the content
    279  * directory.
     276 * `WP_DEBUG_LOG` performs no function unless `WP_DEBUG` is true.
     277 * When `WP_DEBUG_LOG` is true, errors will be logged to debug.log in the
     278 * /wp-content/ directory.
    280279 *
    281280 * Errors are never displayed for XML-RPC requests.
    282281 *
    function wp_debug_mode() { 
    287286        if ( WP_DEBUG ) {
    288287                error_reporting( E_ALL );
    289288
    290                 if ( WP_DEBUG_DISPLAY )
     289                if ( WP_DEBUG_DISPLAY ) {
    291290                        ini_set( 'display_errors', 1 );
    292                 elseif ( null !== WP_DEBUG_DISPLAY )
     291                } elseif ( null !== WP_DEBUG_DISPLAY ) {
    293292                        ini_set( 'display_errors', 0 );
     293                }
    294294
    295295                if ( WP_DEBUG_LOG ) {
    296296                        ini_set( 'log_errors', 1 );
    function wp_debug_mode() { 
    298298                }
    299299        } else {
    300300                error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
     301                if ( null !== WP_DEBUG_DISPLAY ) {
     302                        ini_set( 'display_errors', 0 );
     303                }
    301304        }
    302         if ( defined( 'XMLRPC_REQUEST' ) )
     305        if ( defined( 'XMLRPC_REQUEST' ) ) {
    303306                ini_set( 'display_errors', 0 );
     307        }
    304308}
    305309
    306310/**