WordPress.org

Make WordPress Core

Changeset 45368


Ignore:
Timestamp:
05/20/2019 02:46:35 PM (6 months 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].

Merges [45367] to the 5.2 branch.

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

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-includes/feed.php

    r45247 r45368  
    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.