Make WordPress Core

Ticket #9588: 9588.15.diff

File 9588.15.diff, 1.7 KB (added by Denis-de-Bernardy, 16 years ago)

this one fixes potential cron issues

  • wp-includes/post.php

     
    32363236        if ( get_option('default_pingback_flag') )
    32373237                $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_pingme' ) );
    32383238        $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_encloseme' ) );
    3239         wp_schedule_single_event(time(), 'do_pings');
     3239        wp_schedule_single_event(current_time('timestamp', 1), 'do_pings');
    32403240}
    32413241
    32423242/**
  • wp-includes/cron.php

     
    8888        if ( 0 == $interval )
    8989                return false;
    9090
    91         $now = time();
     91        $now = current_time('timestamp', 1);
    9292
    9393    if ( $timestamp >= $now )
    9494        $timestamp = $now + $interval;
     
    170170function spawn_cron( $local_time = 0 ) {
    171171
    172172        if ( !$local_time )
    173                 $local_time = time();
     173                $local_time = current_time('timestamp', 1);
    174174
    175175        if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
    176176                return;
     
    245245        if ( false === $crons = _get_cron_array() )
    246246                return;
    247247
    248         $local_time = time();
     248        $local_time = current_time('timestamp', 1);
    249249        $keys = array_keys( $crons );
    250250        if ( isset($keys[0]) && $keys[0] > $local_time )
    251251                return;
  • wp-cron.php

     
    3030        die();
    3131
    3232$keys = array_keys( $crons );
    33 $local_time = time();
     33$local_time = current_time('timestamp', 1);
    3434
    3535if ( isset($keys[0]) && $keys[0] > $local_time )
    3636        die();