Bootstrap/Load: Add `nocache_headers()` to all `wp_die()` handlers.
Props spacedmonkey. Fixes #46054. Built from https://develop.svn.wordpress.org/trunk@44828 git-svn-id: http://core.svn.wordpress.org/trunk@44660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
69939e4929
commit
51c0543bf2
|
@ -3058,9 +3058,9 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
|
||||||
|
|
||||||
if ( ! did_action( 'admin_head' ) ) :
|
if ( ! did_action( 'admin_head' ) ) :
|
||||||
if ( ! headers_sent() ) {
|
if ( ! headers_sent() ) {
|
||||||
|
header( 'Content-Type: text/html; charset=utf-8' );
|
||||||
status_header( $r['response'] );
|
status_header( $r['response'] );
|
||||||
nocache_headers();
|
nocache_headers();
|
||||||
header( 'Content-Type: text/html; charset=utf-8' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$text_direction = $r['text_direction'];
|
$text_direction = $r['text_direction'];
|
||||||
|
@ -3238,6 +3238,7 @@ function _json_wp_die_handler( $message, $title = '', $args = array() ) {
|
||||||
if ( null !== $r['response'] ) {
|
if ( null !== $r['response'] ) {
|
||||||
status_header( $r['response'] );
|
status_header( $r['response'] );
|
||||||
}
|
}
|
||||||
|
nocache_headers();
|
||||||
}
|
}
|
||||||
|
|
||||||
echo wp_json_encode( $data );
|
echo wp_json_encode( $data );
|
||||||
|
@ -3265,6 +3266,10 @@ function _xmlrpc_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() ) {
|
||||||
|
nocache_headers();
|
||||||
|
}
|
||||||
|
|
||||||
if ( $wp_xmlrpc_server ) {
|
if ( $wp_xmlrpc_server ) {
|
||||||
$error = new IXR_Error( $r['response'], $message );
|
$error = new IXR_Error( $r['response'], $message );
|
||||||
$wp_xmlrpc_server->output( $error->getXml() );
|
$wp_xmlrpc_server->output( $error->getXml() );
|
||||||
|
@ -3295,9 +3300,12 @@ 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 );
|
||||||
|
|
||||||
// This is intentional. For backward-compatibility, support passing null here.
|
if ( ! headers_sent() ) {
|
||||||
if ( ! headers_sent() && null !== $args['response'] ) {
|
// This is intentional. For backward-compatibility, support passing null here.
|
||||||
status_header( $r['response'] );
|
if ( null !== $args['response'] ) {
|
||||||
|
status_header( $r['response'] );
|
||||||
|
}
|
||||||
|
nocache_headers();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_scalar( $message ) ) {
|
if ( is_scalar( $message ) ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.2-alpha-44827';
|
$wp_version = '5.2-alpha-44828';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue