Make WordPress Core

Ticket #47968: 47968.patch

File 47968.patch, 1.7 KB (added by mauteri, 4 years ago)
  • src/wp-includes/class-wp.php

     
    401401                $headers       = array();
    402402                $status        = null;
    403403                $exit_required = false;
     404                $date_format   = 'D, d M Y H:i:s';
    404405
    405406                if ( is_user_logged_in() ) {
    406407                        $headers = array_merge( $headers, wp_get_nocache_headers() );
     
    408409                        // Unmoderated comments are only visible for 10 minutes via the moderation hash.
    409410                        $expires = 10 * MINUTE_IN_SECONDS;
    410411
    411                         $headers['Expires']       = gmdate( 'D, d M Y H:i:s', time() + $expires );
     412                        $headers['Expires']       = gmdate( $date_format, time() + $expires );
    412413                        $headers['Cache-Control'] = sprintf(
    413414                                'max-age=%d, must-revalidate',
    414415                                $expires
     
    447448                                        )
    448449                                )
    449450                        ) {
    450                                 $wp_last_modified = mysql2date( 'D, d M Y H:i:s', get_lastcommentmodified( 'GMT' ), false );
     451                                $wp_last_modified_post    = mysql2date( $date_format, get_lastpostmodified( 'GMT' ), false );
     452                                $wp_last_modified_comment = mysql2date( $date_format, get_lastcommentmodified( 'GMT' ), false );
     453
     454                                if ( $wp_last_modified_post > $wp_last_modified_comment ) {
     455                                        $wp_last_modified = $wp_last_modified_post;
     456                                } else {
     457                                        $wp_last_modified = $wp_last_modified_comment;
     458                                }
    451459                        } else {
    452                                 $wp_last_modified = mysql2date( 'D, d M Y H:i:s', get_lastpostmodified( 'GMT' ), false );
     460                                $wp_last_modified = mysql2date( $date_format, get_lastpostmodified( 'GMT' ), false );
    453461                        }
    454462
    455463                        if ( ! $wp_last_modified ) {
    456                                 $wp_last_modified = gmdate( 'D, d M Y H:i:s' );
     464                                $wp_last_modified = gmdate( $date_format );
    457465                        }
    458466
    459467                        $wp_last_modified .= ' GMT';