From 05da62cca7b83571ca6dbca95dcc496856a354d5 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 20 May 2019 14:41:59 +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]. Props onlanka, Rarsr, mukesh27. Fixes #47304. git-svn-id: https://develop.svn.wordpress.org/trunk@45367 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/feed.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php index cba5d91a7c..ecb4a25293 100644 --- a/src/wp-includes/feed.php +++ b/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.