Make WordPress Core

Ticket #25365: 25365.diff

File 25365.diff, 1.4 KB (added by adamsilverstein, 10 years ago)

enforce UTC in strtotime calls on gmt values in revisions

  • src/wp-admin/includes/revision.php

     
    130130
    131131        foreach ( $revisions as $revision ) {
    132132                $modified = strtotime( $revision->post_modified );
    133                 $modified_gmt = strtotime( $revision->post_modified_gmt );
     133                $modified_gmt = strtotime( $revision->post_modified_gmt . ' UTC' );
    134134                if ( $can_restore ) {
    135135                        $restore_link = str_replace( '&', '&', wp_nonce_url(
    136136                                add_query_arg(
  • src/wp-includes/comment.php

     
    25182518        if ( ! $days_old )
    25192519                return $posts;
    25202520
    2521         if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) {
     2521        if ( time() - strtotime( $posts[0]->post_date_gmt . ' UTC' ) > ( $days_old * DAY_IN_SECONDS ) ) {
    25222522                $posts[0]->comment_status = 'closed';
    25232523                $posts[0]->ping_status = 'closed';
    25242524        }
     
    25542554        if ( ! in_array( $post->post_type, $post_types ) )
    25552555                return $open;
    25562556
    2557         if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) )
     2557        if ( time() - strtotime( $post->post_date_gmt . ' UTC' ) > ( $days_old * DAY_IN_SECONDS ) )
    25582558                return false;
    25592559
    25602560        return $open;