From 998d381fa089b7c0413558d5fe970981cafde869 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 30 Aug 2018 12:13:24 +0000 Subject: [PATCH] Date/Time: Make sure `current_time()` always calculates the offset from GMT/UTC. Previously, UTC context was implied, but could be unreliable due to being affected by plugins. Props Rarst, rahulsprajapati, marco.marsala. Fixes #37440. Built from https://develop.svn.wordpress.org/trunk@43594 git-svn-id: http://core.svn.wordpress.org/trunk@43423 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 16032f465a..61395c987f 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -69,7 +69,7 @@ function current_time( $type, $gmt = 0 ) { case 'timestamp': return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); default: - return ( $gmt ) ? date( $type ) : date( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ); + return ( $gmt ) ? gmdate( $type ) : gmdate( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 292b5b76ed..ada8f4150a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43593'; +$wp_version = '5.0-alpha-43594'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.