Make WordPress Core


Ignore:
Timestamp:
07/06/2021 08:20:51 PM (4 years ago)
Author:
iandunn
Message:

Multisite: Log error/warnings/notices from ms-files.php.

Previously errors were not displayed or logged, but the original intention was only to prevent them from being displayed. Hiding them from logs makes problems like #53492 much harder to debug.

This makes the handling of errors in ms-files consistent with the REST API, admin-ajax, and XML-RPC.

Props iandunn, johnjamesjacoby.
Fixes #53493.

File:
1 edited

Legend:

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

    r51301 r51358  
    416416 * When `WP_DEBUG_LOG` is a valid path, errors will be logged to the specified file.
    417417 *
    418  * Errors are never displayed for XML-RPC, REST, and Ajax requests.
     418 * Errors are never displayed for XML-RPC, REST, `ms-files.php`, and Ajax requests.
    419419 *
    420420 * @since 3.0.0
     
    482482    }
    483483
    484     if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() || wp_is_json_request() ) {
     484    if (
     485        defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || defined( 'MS_FILES_REQUEST' ) ||
     486        ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) ||
     487        wp_doing_ajax() || wp_is_json_request() ) {
    485488        ini_set( 'display_errors', 0 );
    486489    }
Note: See TracChangeset for help on using the changeset viewer.