From afbc7be282e35be03780b6b554ef8dbf1a1d7a04 Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Tue, 22 Nov 2022 14:33:39 +0100 Subject: [PATCH] Simplify slightly complex code reading time zone settings Change-Id: I30348e27392df03ce775db0e9f8bb055966d2381 --- src/RevisionSliderHooks.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/RevisionSliderHooks.php b/src/RevisionSliderHooks.php index dfe0d183..d27c458c 100644 --- a/src/RevisionSliderHooks.php +++ b/src/RevisionSliderHooks.php @@ -75,11 +75,9 @@ class RevisionSliderHooks { $stats->increment( 'RevisionSlider.event.hookinit' ); $config = self::getConfig(); - $timeOffset = $config->get( 'LocalTZoffset' ); - if ( $config->get( 'Localtimezone' ) === null ) { - $timeOffset = 0; - } elseif ( $timeOffset === null ) { - $timeOffset = 0; + $timeOffset = 0; + if ( $config->get( 'Localtimezone' ) !== null ) { + $timeOffset = $config->get( 'LocalTZoffset' ) ?? 0; } $autoExpand = $userOptionsLookup->getBoolOption( $user, 'userjs-revslider-autoexpand' );