From ad631f135d460fb8a5c301f5959257041e6252d2 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 5 Aug 2016 08:17:48 +0000 Subject: [PATCH] Register a default value for the timecorrection preference Previously it had no default value, which means that certain things did not consider it a real option (e.g. userOptions.php). Additionally, this was causing preferences to get confused into thinking that users who did not set a timezone have really selected offset 00:00, so saving the page could change the user's timezone to UTC even if they did not touch the setting. Change-Id: I875c5ab6472324f9bdfdaa784441fbc381087707 --- includes/Setup.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/Setup.php b/includes/Setup.php index 6c5de90939..22462c0a7f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -654,6 +654,9 @@ date_default_timezone_set( $wgLocaltimezone ); if ( is_null( $wgLocalTZoffset ) ) { $wgLocalTZoffset = date( 'Z' ) / 60; } +// The part after the System| is ignored, but rest of MW fills it +// out as the local offset. +$wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset"; if ( !$wgDBerrorLogTZ ) { $wgDBerrorLogTZ = $wgLocaltimezone; -- 2.20.1