Make WordPress Core

Opened 2 years ago

Last modified 8 weeks ago

#47968 new defect (bug)

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

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


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.

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 7 months ago.
47968.1.patch (4.2 KB) - added by mauteri 6 months ago.
Updated patch with code adjustment and unit test.

Download all attachments as: .zip

Change History (5)

7 months ago

6 months ago

Updated patch with code adjustment and unit test.

#1 @mauteri
6 months ago

  • Keywords has-patch has-unit-tests added

#2 @SergeyBiryukov
6 months ago

  • Milestone changed from Awaiting Review to 5.9

#3 @hellofromTonya
8 weeks ago

  • Milestone changed from 5.9 to 6.0

5.9 Beta 1 is happening in less than 30 minutes. I'm sorry this ticket didn't get a review and testing in time. As it's a bug that was not introduced in 5.9 cycle, moving it to 6.0 to give it the time and attention it deserves.

Note: See TracTickets for help on using tickets.