From 67a24255754052bbd4b34a2e17f5b079461a379f Mon Sep 17 00:00:00 2001 From: desrosj Date: Mon, 20 May 2019 14:47:54 +0000 Subject: [PATCH] =?UTF-8?q?Feeds:=20Ensure=20a=20feed=E2=80=99s=20``=20has=20the=20correct=20date.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Built from https://develop.svn.wordpress.org/branches/5.2@45368 git-svn-id: http://core.svn.wordpress.org/branches/5.2@45179 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/feed.php | 9 +-------- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/wp-includes/feed.php b/wp-includes/feed.php index cba5d91a7c..ecb4a25293 100644 --- a/wp-includes/feed.php +++ b/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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 1cb9c6ed10..0014662cfd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2.1-RC1-45366'; +$wp_version = '5.2.1-RC1-45368'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.