From 0d4a6d0f6ecf02935e323126c41206467504975b Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Tue, 16 Feb 2016 01:35:40 +0000 Subject: [PATCH] =?UTF-8?q?REST=20API:=20Don=E2=80=99t=20display=20errors?= =?UTF-8?q?=20during=20REST=20API=20requests.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses `wp_debug_mode()` to prevent response from being broken by debug errors. Matches similar behavior of the XML-RPC API. Props rockwell15. Fixes #34915. git-svn-id: https://develop.svn.wordpress.org/trunk@36530 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/load.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index ec59459f80..44b4ed255f 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -300,8 +300,9 @@ 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' ) ) + if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) ) { ini_set( 'display_errors', 0 ); + } } /**