From e9fc71bbbe8bb5353dbc874e0496ae52e09681b3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 20 Jun 2019 14:10:44 +0000 Subject: [PATCH] Date/Time: Eliminate use of `date_default_timezone_set()` for determining DST status on General Options screen. Time calculations should not need to rely on manipulating global PHP configuration state. Props Rarst. Fixes #46483. git-svn-id: https://develop.svn.wordpress.org/trunk@45556 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/options-general.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php index dad6f94f3f..ff50e6fbd4 100644 --- a/src/wp-admin/options-general.php +++ b/src/wp-admin/options-general.php @@ -252,10 +252,10 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists

format( 'I' ); + + if ( $dst ) { _e( 'This timezone is currently in daylight saving time.' ); } else { _e( 'This timezone is currently in standard time.' ); @@ -296,8 +296,6 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists _e( 'This timezone does not observe daylight saving time.' ); } } - // Set back to UTC. - date_default_timezone_set( 'UTC' ); ?>