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/src/wp-admin/includes/upgrade.php

    r45030 r45424  
    942942    $time_difference = $all_options->time_difference;
    943943
    944         $server_time = time() + date( 'Z' );
     944        $server_time = time() + gmdate( 'Z' );
    945945    $weblogger_time  = $server_time + $time_difference * HOUR_IN_SECONDS;
    946946    $gmt_time        = time();
Note: See TracChangeset for help on using the changeset viewer.