From 956627ff83322bd04b068326dd91a3274c5b2a25 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Thu, 18 Feb 2016 16:43:27 +0000 Subject: [PATCH] Don't display errors during Ajax requests. See #34915 for REST and #23811 for XML-RPC. Props pento. Fixes #26262. Built from https://develop.svn.wordpress.org/trunk@36571 git-svn-id: http://core.svn.wordpress.org/trunk@36538 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/load.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/load.php b/wp-includes/load.php index 44b4ed255f..2f2d95b300 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -279,7 +279,7 @@ function timer_stop( $display = 0, $precision = 3 ) { * When `WP_DEBUG_LOG` is true, errors will be logged to debug.log in the content * directory. * - * Errors are never displayed for XML-RPC requests. + * Errors are never displayed for XML-RPC, REST, and Ajax requests. * * @since 3.0.0 * @access private @@ -300,7 +300,8 @@ function wp_debug_mode() { } else { 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 ); } - if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) ) { + + if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { ini_set( 'display_errors', 0 ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6f68f366c3..4b19e13fab 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36570'; +$wp_version = '4.5-alpha-36571'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.