Make WordPress Core

Ticket #42413: 42413.2.diff

File 42413.2.diff, 1.4 KB (added by westonruter, 7 years ago)
  • src/wp-includes/class-wp-customize-manager.php

    diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
    index 12256d2173..4a527b7b91 100644
    final class WP_Customize_Manager { 
    45694569                        $changeset_post = get_post( $changeset_post_id );
    45704570                }
    45714571
    4572                 if ( $this->changeset_post_id() && 'future' === get_post_status( $this->changeset_post_id() ) ) {
    4573                         $initial_date = get_the_time( 'Y-m-d H:i:s', $this->changeset_post_id() );
    4574                 } else {
    4575                         $initial_date = current_time( 'mysql', false );
     4572                // Determine initial date to be at present or future, not past.
     4573                $current_time = current_time( 'mysql', false );
     4574                $initial_date = $current_time;
     4575                if ( $changeset_post ) {
     4576                        $initial_date = get_the_time( 'Y-m-d H:i:s', $changeset_post->ID );
     4577                }
     4578                if ( $initial_date < $current_time ) {
     4579                        $initial_date = $current_time;
    45764580                }
    45774581
    45784582                $lock_user_id = false;
    final class WP_Customize_Manager { 
    45934597                                'statusChoices' => $status_choices,
    45944598                                'lockUser' => $lock_user_id ? $this->get_lock_user_data( $lock_user_id ) : null,
    45954599                        ),
    4596                         'initialServerDate' => current_time( 'mysql', false ),
     4600                        'initialServerDate' => $current_time,
    45974601                        'dateFormat' => get_option( 'date_format' ),
    45984602                        'timeFormat' => get_option( 'time_format' ),
    45994603                        'initialServerTimestamp' => floor( microtime( true ) * 1000 ),