WordPress.org

Make WordPress Core

Ticket #9588: 9588.9.diff

File 9588.9.diff, 1.1 KB (added by Denis-de-Bernardy, 5 years ago)
  • wp-includes/comment.php

     
    189189        $key = md5( serialize( compact(array_keys($defaults)) )  ); 
    190190        $last_changed = wp_cache_get('last_changed', 'comment'); 
    191191        if ( !$last_changed ) { 
    192                 $last_changed = time(); 
     192                $last_changed = current_time('timestamp'); 
    193193                wp_cache_set('last_changed', $last_changed, 'comment'); 
    194194        } 
    195195        $cache_key = "get_comments:$key:$last_changed"; 
     
    16011601        if ( !$days_old ) 
    16021602                return $posts; 
    16031603 
    1604         if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) { 
     1604        if ( strtotime(gmdate("Y-m-d H:i:s")) - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) { 
    16051605                $posts[0]->comment_status = 'closed'; 
    16061606                $posts[0]->ping_status = 'closed'; 
    16071607        } 
     
    16321632 
    16331633        $post = get_post($post_id); 
    16341634 
    1635         if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) 
     1635        if ( strtotime(gmdate("Y-m-d H:i:s")) - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) 
    16361636                return false; 
    16371637 
    16381638        return $open;