Make WordPress Core


Ignore:
Timestamp:
04/05/2019 03:19:50 PM (6 years ago)
Author:
flixos90
Message:

Bootstrap/Load: Ensure WP_Fatal_Error_Handler does not conflict with existing mechanisms treating fatal errors.

Prior to this change, resuming or activating a plugin or theme that is still broken would result in a redirect loop if in recovery mode. If outside recovery mode, it would cause the error template to be displayed.

Furthermore this applies to breaking a plugin or theme when editing from the backend.

Props aandrewdixon, azaozz, dhanukanuwan, henrywright, ocean90, ohiosierra, PandelisZ, xkon.
Fixes #46045, #46751.

File:
1 edited

Legend:

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

    r45085 r45114  
    632632            wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); // we'll override this later if the plugin can be included without fatal error
    633633        }
     634
    634635        ob_start();
    635636        wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    636637        $_wp_plugin_file = $plugin;
     638        define( 'WP_SANDBOX_SCRAPING', true );
    637639        include_once( WP_PLUGIN_DIR . '/' . $plugin );
    638640        $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.
     
    21262128 */
    21272129function plugin_sandbox_scrape( $plugin ) {
     2130    define( 'WP_SANDBOX_SCRAPING', true );
    21282131    wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    21292132    include( WP_PLUGIN_DIR . '/' . $plugin );
Note: See TracChangeset for help on using the changeset viewer.