Bootstrap/Load: Fix bug causing AJAX functions to return a 500 when passing a null response to wp_die().

This bug was introduced in [44497].

Props ocean90.
See #45933.


git-svn-id: https://develop.svn.wordpress.org/trunk@44673 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz 2019-01-21 20:06:24 +00:00
parent 44ce02e28a
commit 43bbbbf8b8

View File

@ -3293,7 +3293,8 @@ function _ajax_wp_die_handler( $message, $title = '', $args = array() ) {
list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args ); list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
if ( ! headers_sent() && null !== $r['response'] ) { // This is intentional. For backward-compatibility, support passing null here.
if ( ! headers_sent() && null !== $args['response'] ) {
status_header( $r['response'] ); status_header( $r['response'] );
} }