WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/21/2019 07:09:23 PM (16 months ago)
Author:
flixos90
Message:

Bootstrap/Load: Ensure that the fatal error shutdown handler does not prevent other shutdown handlers from being called.

This changeset adds support for a new wp_die() argument exit, which defaults to true and determines whether wp_die() should actually terminate the request. The new fatal error handler then calls wp_die() with that argument set to false, as calling die() or exit from a PHP shutdown function prevents other shutdown functions from being called.

Props schlessera, johnbillion.
Fixes #46038. See #44458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-shutdown-handler.php

    r44624 r44671  
    137137            if ( is_readable( $php_error_pluggable ) ) {
    138138                require_once $php_error_pluggable;
    139                 die();
     139                return;
    140140            }
    141141        }
     
    167167        $message = __( 'The site is experiencing technical difficulties.' );
    168168
    169         $args = array( 'response' => 500 );
     169        $args = array(
     170            'response' => 500,
     171            'exit'     => false,
     172        );
    170173        if ( function_exists( 'admin_url' ) ) {
    171174            $args['link_url']  = admin_url();
Note: See TracChangeset for help on using the changeset viewer.