Make WordPress Core

Changeset 21954 for trunk/wp-cron.php


Ignore:
Timestamp:
09/23/2012 04:57:21 PM (13 years ago)
Author:
nacin
Message:

Use $gmt_time rather than $local_time in cron, since it uses GMT/UTC and not a local timestamp. see #14391.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-cron.php

    r19722 r21954  
    4949
    5050$keys = array_keys( $crons );
    51 $local_time = microtime( true );
     51$gmt_time = microtime( true );
    5252
    53 if ( isset($keys[0]) && $keys[0] > $local_time )
     53if ( isset($keys[0]) && $keys[0] > $gmt_time )
    5454    die();
    5555
     
    6060    if ( empty( $_GET[ 'doing_wp_cron' ] ) ) {
    6161        // Called from external script/job. Try setting a lock.
    62         if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $local_time ) )
     62        if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) )
    6363            return;
    6464        $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
     
    7474
    7575foreach ( $crons as $timestamp => $cronhooks ) {
    76     if ( $timestamp > $local_time )
     76    if ( $timestamp > $gmt_time )
    7777        break;
    7878
Note: See TracChangeset for help on using the changeset viewer.