Skip to content
Permalink
Browse files

Feeds: Ensure a feed’s `<lastBuildDate>` has the correct date.

The maximum modified time for a is currently being determined after an arbitrary date format is applied. Because the string sort in `max()` is being used to return the highest (most recent) modified value, the incorrect date is sometimes returned. This was introduced in [45247].

Merges [45367] to the 5.2 branch.

Reviewed by desrosj, SergeyBiryukov.
Props onlanka, Rarst, mukesh27.
Fixes #47304.

git-svn-id: https://develop.svn.wordpress.org/branches/5.2@45368 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed May 20, 2019
1 parent 62e03d5 commit 6381269b8a0f73a749d6648217db51d07c900bb0
Showing with 1 addition and 8 deletions.
  1. +1 −8 src/wp-includes/feed.php
@@ -672,14 +672,7 @@ function get_feed_build_date( $format ) {
}
// Determine the maximum modified time.
$max_modified_time = max(
array_map(
function ( $time ) use ( $format ) {
return mysql2date( $format, $time, false );
},
$modified_times
)
);
$max_modified_time = mysql2date( $format, max( $modified_times ), false );
/**
* Filters the date the last post or comment in the query was modified.

0 comments on commit 6381269

Please sign in to comment.
You can’t perform that action at this time.