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 ) { |
267 | 267 | * It is strongly recommended that plugin and theme developers use `WP_DEBUG` |
268 | 268 | * in their development environments. |
269 | 269 | * |
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. |
272 | 275 | * |
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. |
280 | 279 | * |
281 | 280 | * Errors are never displayed for XML-RPC requests. |
282 | 281 | * |
… |
… |
function wp_debug_mode() { |
287 | 286 | if ( WP_DEBUG ) { |
288 | 287 | error_reporting( E_ALL ); |
289 | 288 | |
290 | | if ( WP_DEBUG_DISPLAY ) |
| 289 | if ( WP_DEBUG_DISPLAY ) { |
291 | 290 | ini_set( 'display_errors', 1 ); |
292 | | elseif ( null !== WP_DEBUG_DISPLAY ) |
| 291 | } elseif ( null !== WP_DEBUG_DISPLAY ) { |
293 | 292 | ini_set( 'display_errors', 0 ); |
| 293 | } |
294 | 294 | |
295 | 295 | if ( WP_DEBUG_LOG ) { |
296 | 296 | ini_set( 'log_errors', 1 ); |
… |
… |
function wp_debug_mode() { |
298 | 298 | } |
299 | 299 | } else { |
300 | 300 | 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 | } |
301 | 304 | } |
302 | | if ( defined( 'XMLRPC_REQUEST' ) ) |
| 305 | if ( defined( 'XMLRPC_REQUEST' ) ) { |
303 | 306 | ini_set( 'display_errors', 0 ); |
| 307 | } |
304 | 308 | } |
305 | 309 | |
306 | 310 | /** |