diff --git a/wp-includes/post.php b/wp-includes/post.php index 7636c3d02b..306e567bb9 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3663,14 +3663,13 @@ function wp_insert_post( $postarr, $wp_error = false ) { } if ( 'attachment' !== $post_type ) { - if ( 'publish' == $post_status ) { - $now = gmdate( 'Y-m-d H:i:59' ); - if ( mysql2date( 'U', $post_date_gmt, false ) > mysql2date( 'U', $now, false ) ) { + 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' ) ) { $post_status = 'future'; } - } elseif ( 'future' == $post_status ) { - $now = gmdate( 'Y-m-d H:i:59' ); - if ( mysql2date( 'U', $post_date_gmt, false ) <= mysql2date( 'U', $now, false ) ) { + } elseif ( 'future' === $post_status ) { + if ( $post_date_gmt <= gmdate( 'Y-m-d H:i:59' ) ) { $post_status = 'publish'; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index e4c76f0ea0..5a3e022021 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45850'; +$wp_version = '5.3-alpha-45851'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.