WordPress.org

Make WordPress Core

Changeset 36530


Ignore:
Timestamp:
02/16/2016 01:35:40 AM (4 years ago)
Author:
rachelbaker
Message:

REST API: Don’t display errors during REST API requests.

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r36434 r36530  
    301301        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 );
    302302    }
    303     if ( defined( 'XMLRPC_REQUEST' ) )
     303    if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) ) {
    304304        ini_set( 'display_errors', 0 );
     305    }
    305306}
    306307
Note: See TracChangeset for help on using the changeset viewer.