Make WordPress Core

Changeset 44828


Ignore:
Timestamp:
03/11/2019 11:46:41 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Bootstrap/Load: Add nocache_headers() to all wp_die() handlers.

Props spacedmonkey.
Fixes #46054.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r44827 r44828  
    30593059    if ( ! did_action( 'admin_head' ) ) :
    30603060        if ( ! headers_sent() ) {
     3061            header( 'Content-Type: text/html; charset=utf-8' );
    30613062            status_header( $r['response'] );
    30623063            nocache_headers();
    3063             header( 'Content-Type: text/html; charset=utf-8' );
    30643064        }
    30653065
     
    32393239            status_header( $r['response'] );
    32403240        }
     3241        nocache_headers();
    32413242    }
    32423243
     
    32653266
    32663267    list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
     3268
     3269    if ( ! headers_sent() ) {
     3270        nocache_headers();
     3271    }
    32673272
    32683273    if ( $wp_xmlrpc_server ) {
     
    32963301    list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
    32973302
    3298     // This is intentional. For backward-compatibility, support passing null here.
    3299     if ( ! headers_sent() && null !== $args['response'] ) {
    3300         status_header( $r['response'] );
     3303    if ( ! headers_sent() ) {
     3304        // This is intentional. For backward-compatibility, support passing null here.
     3305        if ( null !== $args['response'] ) {
     3306            status_header( $r['response'] );
     3307        }
     3308        nocache_headers();
    33013309    }
    33023310
Note: See TracChangeset for help on using the changeset viewer.