WordPress.org

Make WordPress Core

Ticket #46045: 46045.diff

File 46045.diff, 1.9 KB (added by flixos90, 14 months ago)
  • src/wp-admin/includes/plugin.php

    diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
    index 54c6db27ac..a6220466a4 100644
    a b function wp_clean_plugins_cache( $clear_update_cache = true ) { 
    21252125 * @param string $plugin Path to the plugin file relative to the plugins directory.
    21262126 */
    21272127function plugin_sandbox_scrape( $plugin ) {
     2128        define( 'WP_SANDBOX_SCRAPING', true );
    21282129        wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    21292130        include( WP_PLUGIN_DIR . '/' . $plugin );
    21302131}
  • src/wp-admin/includes/theme.php

    diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php
    index 1ab7959e5f..98391123aa 100644
    a b function resume_theme( $theme, $redirect = '' ) { 
    859859
    860860                        // Load the theme's functions.php to test whether it throws a fatal error.
    861861                        ob_start();
     862                        define( 'WP_SANDBOX_SCRAPING', true );
    862863                        include $functions_path;
    863864                        ob_clean();
    864865                }
  • src/wp-includes/class-wp-fatal-error-handler.php

    diff --git a/src/wp-includes/class-wp-fatal-error-handler.php b/src/wp-includes/class-wp-fatal-error-handler.php
    index 8ec87c9e24..270bb9e444 100644
    a b class WP_Fatal_Error_Handler { 
    2626         * @since 5.2.0
    2727         */
    2828        public function handle() {
     29                if ( defined( 'WP_SANDBOX_SCRAPING' ) && WP_SANDBOX_SCRAPING ) {
     30                        return;
     31                }
     32
    2933                try {
    3034                        // Bail if no error found.
    3135                        $error = $this->detect_error();
  • src/wp-includes/load.php

    diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
    index f2c9318da6..1915fbde17 100644
    a b function wp_start_scraping_edited_file_errors() { 
    14441444                echo "###### wp_scraping_result_end:$key ######";
    14451445                die();
    14461446        }
     1447        define( 'WP_SANDBOX_SCRAPING', true );
    14471448        register_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key );
    14481449}
    14491450