Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#47623 new defect (bug)

Feeds: <lastBuildDate> has incorrect date

Reported by: gustavogomes's profile gustavogomes Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.2.2
Component: Feeds Keywords: has-patch
Focuses: Cc:

Description

The feed shouldn't use only the 'post_modified_gmt' to define the lastBuildDate it does not always correspond to the date to be used.
So, on the file wp-includes/feed.php
Instead of

<?php
        // Extract the post modified times from the posts.
        $modified_times = wp_list_pluck( $wp_query->posts, 'post_modified_gmt' );

Should be

<?php
        // Extract the post modified times from the posts.
        $modified_times = wp_list_pluck( $wp_query->posts, 'post_modified_gmt' );
        $modified_times = array_merge( $modified_times, wp_list_pluck( $wp_query->posts, 'post_date_gmt' ) );

this is causing the feed to not update the lastBuildDate when you schedule the post.

Attachments (1)

47623.diff (623 bytes) - added by gustavogomes 5 years ago.

Download all attachments as: .zip

Change History (3)

@gustavogomes
5 years ago

#1 @gustavogomes
5 years ago

  • Keywords has-patch added; needs-patch removed

#2 @SergeyBiryukov
5 years ago

  • Keywords has-dev-note removed

Related: [44948] / [45247], #4575.

Note: See TracTickets for help on using tickets.