Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp.php

    r23281 r22303  
    379379        if ( ! empty( $status ) )
    380380            status_header( $status );
    381 
    382         // If Last-Modified is set to false, it should not be sent (no-cache situation).
    383         if ( isset( $headers['Last-Modified'] ) && false === $headers['Last-Modified'] ) {
    384             unset( $headers['Last-Modified'] );
    385 
    386             // In PHP 5.3+, make sure we are not sending a Last-Modified header.
    387             if ( function_exists( 'header_remove' ) ) {
    388                 @header_remove( 'Last-Modified' );
    389             } else {
    390                 // In PHP 5.2, send an empty Last-Modified header, but only as a
    391                 // last resort to override a header already sent. #WP23021
    392                 foreach ( headers_list() as $header ) {
    393                     if ( 0 === stripos( $header, 'Last-Modified' ) ) {
    394                         $headers['Last-Modified'] = '';
    395                         break;
    396                     }
    397                 }
    398             }
    399         }
    400 
    401381        foreach( (array) $headers as $name => $field_value )
    402382            @header("{$name}: {$field_value}");
     383
     384        if ( isset( $headers['Last-Modified'] ) && empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) )
     385            @header_remove( 'Last-Modified' );
    403386
    404387        if ( $exit_required )
Note: See TracChangeset for help on using the changeset viewer.