[wp-trac] [WordPress Trac] #38027: Comments feed returns invalid timestamp in http headers when there are no comments
WordPress Trac
noreply at wordpress.org
Tue Oct 25 20:47:08 UTC 2016
#38027: Comments feed returns invalid timestamp in http headers when there are no
comments
--------------------------------------+--------------------------
Reporter: dllh | Owner: rachelbaker
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.7
Component: Comments | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+--------------------------
Changes (by rachelbaker):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"38925"]:
{{{
#!CommitTicketReference repository="" revision="38925"
Feeds: Always return a valid timestamp for the Last-Modified header of
comment or post feeds.
Fixes bug where an invalid Last-Modified value would be returned in feed
requests for sites that had 0 items to return. Comment or post feeds will
now return the current timestamp as the Last-Modified header value.
Example: a request for the comments feed for a site without any comments.
Replaced use of the local static variable `$cache_lastcommentmodified` to
store the modified date in `get_lastcommentmodified()` with the Object
Cache API. The `get_lastcommentmodified()` function returns early if
there is a cached value and returns `false` if there where no comments
found. Introduced `_clear_modified_cache_on_transition_comment_status()`
to flush the `lastcommentmodified` cache key when a comment enters or
leaves approval status. In `get_lastpostmodified()` return early if there
is a cached value and return `false` if there are no posts found.
Props swissspidy, rachelbaker, dllh, leobaiano.
Fixes #38027.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38027#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list