Make WordPress Core

Changeset 46756


Ignore:
Timestamp:
11/21/2019 01:16:50 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Remove mysql2date() usage in get_feed_build_date() to ensure the output includes correct timezone offset.

With the changes in [45908], mysql2date() works correctly for all local time inputs, but should not be used for UTC time inputs.

Add a unit test.

Props Rarst, lisota.
Fixes #48675.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r46732 r46756  
    683683
    684684        // Determine the maximum modified time.
    685         $max_modified_time = mysql2date( $format, max( $modified_times ), false );
     685        $datetime = date_create_immutable_from_format(
     686                'Y-m-d h:i:s',
     687                max( $modified_times ),
     688                new DateTimeZone( 'UTC' )
     689        );
     690
     691        $max_modified_time = $datetime->format( $format );
    686692
    687693        /**
Note: See TracChangeset for help on using the changeset viewer.