Make WordPress Core

Ticket #61711: 61711-2.diff

File 61711-2.diff, 591 bytes (added by haozi, 8 weeks ago)
  • src/wp-includes/class-wp.php

    diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php
    index ce88c102cfade..bc06eb9e50bf0 100644
    a b public function send_headers() { 
    545545                        if ( $post && pings_open( $post ) ) {
    546546                                $headers['X-Pingback'] = get_bloginfo( 'pingback_url', 'display' );
    547547                        }
     548
     549                        // Send nocache headers for password protected posts to avoid reverse-proxy or CDNs caching.
     550                        if ( ! empty( $post->post_password ) ) {
     551                                $headers = array_merge( $headers, wp_get_nocache_headers() );
     552                        }
    548553                }
    549554
    550555                /**