WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 7 weeks ago

#47968 new defect (bug)

Feed (with comments) Last-Modified header only considers latest comment date

Reported by: xiven Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.2.2
Component: Feeds Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Steps to reproduce:

  1. Create a wordpress blog
  2. Add a post
  3. Add a comment to that post
  4. Wait a while
  5. Add another post
  6. Check the Last-Modified header of the blog's feed

Expected result:
The Last-Modified header should have the date/time of the post added in step 5.

Actual result:
The Last-Modified header has the date/time of the comment added in step 3. This behaviour breaks caching and causes feed readers to believe there is no new content even when there might be new posts.

Analysis:
The fault lies in the send_headers function of class-wp.php. For a feed including comments it should use the newest date from both the get_lastcommentmodified and the get_lastpostmodified functions instead of only using the result from the get_lastcommentmodified function.

Attachments (2)

47968.patch (1.7 KB) - added by mauteri 3 months ago.
47968.1.patch (4.2 KB) - added by mauteri 8 weeks ago.
Updated patch with code adjustment and unit test.

Download all attachments as: .zip

Change History (4)

@mauteri
3 months ago

@mauteri
8 weeks ago

Updated patch with code adjustment and unit test.

#1 @mauteri
8 weeks ago

  • Keywords has-patch has-unit-tests added

#2 @SergeyBiryukov
7 weeks ago

  • Milestone changed from Awaiting Review to 5.9
Note: See TracTickets for help on using tickets.