diff --git a/wp-includes/post.php b/wp-includes/post.php index 812be58ed8..6ffd960c72 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3753,13 +3753,14 @@ function wp_insert_post( $postarr, $wp_error = false ) { } if ( 'attachment' !== $post_type ) { + $now = gmdate( 'Y-m-d H:i:s' ); + if ( 'publish' === $post_status ) { - // String comparison to work around far future dates (year 2038+) on 32-bit systems. - if ( $post_date_gmt > gmdate( 'Y-m-d H:i:59' ) ) { + if ( strtotime( $post_date_gmt ) - strtotime( $now ) >= MINUTE_IN_SECONDS ) { $post_status = 'future'; } } elseif ( 'future' === $post_status ) { - if ( $post_date_gmt <= gmdate( 'Y-m-d H:i:59' ) ) { + if ( strtotime( $post_date_gmt ) - strtotime( $now ) < MINUTE_IN_SECONDS ) { $post_status = 'publish'; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 09956555cf..bd85ac9d30 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46967'; +$wp_version = '5.4-alpha-46968'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.