Make WordPress Core


Ignore:
Timestamp:
05/26/2019 12:11:37 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Replace all instances of date() with gmdate().

Use of date() in core depends on PHP timezone set to UTC and not changed by third party code (which cannot be guaranteed).

gmdate() is functionally equivalent, but is not affected by PHP timezone setting: it's always UTC, which is the exact behavior the core needs.

Props nielsdeblaauw, Rarst.
Fixes #46438. See #44491.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment-submission.php

    r43571 r45424  
    134134        $post = self::factory()->post->create_and_get(
    135135            array(
    136                 'post_date' => date( 'Y-m-d H:i:s', strtotime( '+1 day' ) ),
     136                'post_date' => gmdate( 'Y-m-d H:i:s', strtotime( '+1 day' ) ),
    137137            )
    138138        );
Note: See TracChangeset for help on using the changeset viewer.