Make WordPress Core

Changeset 45367


Ignore:
Timestamp:
05/20/2019 02:41:59 PM (5 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/feed.php

    r45247 r45367  
    673673
    674674    // Determine the maximum modified time.
    675     $max_modified_time = max(
    676         array_map(
    677             function ( $time ) use ( $format ) {
    678                 return mysql2date( $format, $time, false );
    679             },
    680             $modified_times
    681         )
    682     );
     675    $max_modified_time = mysql2date( $format, max( $modified_times ), false );
    683676
    684677    /**
Note: See TracChangeset for help on using the changeset viewer.