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].

Props onlanka, Rarsr, mukesh27.
Fixes #47304.
Built from https://develop.svn.wordpress.org/trunk@45367


git-svn-id: http://core.svn.wordpress.org/trunk@45178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2019-05-20 14:43:02 +00:00
parent 3b926e0b47
commit ee92fc277c
2 changed files with 2 additions and 9 deletions

View File

@ -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.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45365';
$wp_version = '5.3-alpha-45367';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.