Commit b1d826fb6e for wordpress.org
commit b1d826fb6e0bd5f8ffcad511658e8de8a60e6a42
Author: hellofromTonya <hellofromTonya@git.wordpress.org>
Date: Tue Mar 28 14:22:21 2023 +0000
Date/Time: Revert [55054].
This changeset introduced a regression for partial-hour timezones such as +05:30 UTC which is India and Sri Lanka. How? These timezones are in float. The change made in [55054] type casted them to integer which dropped the decimal for the partial-hour, making the time inaccurate. For example, +05:30 UTC (India and Sri Lanka)'s `'gmt_offset'` is `5.5`, but with the changeset, it was changed to `5`.
Reverting the changeset restores the original state of `current_time()` and thus resolves the regression.
Props reputeinfosystems, Rarst, hellofromTonya, desrosj, audrasjb, sergeybiryukov, costdev, priethor, francina, nekojonez, codingchicken, cbringmann.
See #57035.
Fixes #57998.
Built from https://develop.svn.wordpress.org/trunk@55598
git-svn-id: http://core.svn.wordpress.org/trunk@55110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 17e5a7c2ea..1cd71b3f75 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -73,7 +73,7 @@ function mysql2date( $format, $date, $translate = true ) {
function current_time( $type, $gmt = 0 ) {
// Don't use non-GMT timestamp, unless you know the difference and really need to.
if ( 'timestamp' === $type || 'U' === $type ) {
- return $gmt ? time() : time() + ( (int) get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
+ return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
}
if ( 'mysql' === $type ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 083635c7a1..3a1b55dae8 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '6.3-alpha-55597';
+$wp_version = '6.3-alpha-55598';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.