From 43bbbbf8b8fc43f4ae4603a90c1897c24a30f1b6 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 21 Jan 2019 20:06:24 +0000 Subject: [PATCH] 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 --- src/wp-includes/functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 400161d8e7..8ee93b4746 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3293,7 +3293,8 @@ function _ajax_wp_die_handler( $message, $title = '', $args = array() ) { 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'] ); }