mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@43594 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user