Make WordPress Core

Changeset 51358


Ignore:
Timestamp:
07/06/2021 08:20:51 PM (3 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.

Location:
trunk
Files:
1 added
2 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    }
  • trunk/src/wp-includes/ms-files.php

    r47219 r51358  
    99 */
    1010
     11define( 'MS_FILES_REQUEST', true );
    1112define( 'SHORTINIT', true );
    1213require_once dirname( __DIR__ ) . '/wp-load.php';
     
    1718
    1819ms_file_constants();
    19 
    20 error_reporting( 0 );
    2120
    2221if ( '1' == $current_blog->archived || '1' == $current_blog->spam || '1' == $current_blog->deleted ) {
Note: See TracChangeset for help on using the changeset viewer.