Ticket #3027: 3027.diff

File 3027.diff, 1007 bytes (added by Nazgul, 6 years ago)
  • wp-includes/classes.php

     
    171171                        nocache_headers(); 
    172172                if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) { 
    173173                        status_header( 404 ); 
     174                        if ( !is_user_logged_in() ) 
     175                                nocache_headers(); 
    174176                        @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 
    175177                } else if ( empty($this->query_vars['feed']) ) { 
    176178                        @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 
     
    260262                if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) { 
    261263                        $wp_query->set_404(); 
    262264                        status_header( 404 ); 
     265                        nocache_headers(); 
    263266                }       elseif( is_404() != true ) { 
    264267                        status_header( 200 ); 
    265268                }