From: Bartosz DziewoƄski Date: Mon, 23 Jul 2018 22:35:34 +0000 (+0200) Subject: Remove incorrect timezone conversion from date parameters X-Git-Tag: 1.34.0-rc.0~4408^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=eea5d3ee67725609c3964504cf82d62a01cc60bd;p=lhc%2Fweb%2Fwiklou.git Remove incorrect timezone conversion from date parameters This affects at least Special:Log and Special:Contributions. The setTimezone() call does not actually change the offset used for database lookup, because getTimestamp() returns a Unix timestamp, which by definition does not include timezone information. We don't actually want to do anything with timezones here. Whether we like it or not, these date selectors have always used UTC dates. Follow-up to I8c2cd398d7c7ac68a8f46ee94cb9e7c6beed5694. Change-Id: Ia034017af5b37da3aa4889d5b7680c8be423126e --- diff --git a/includes/pager/RangeChronologicalPager.php b/includes/pager/RangeChronologicalPager.php index d3cb566823..bf36983530 100644 --- a/includes/pager/RangeChronologicalPager.php +++ b/includes/pager/RangeChronologicalPager.php @@ -45,14 +45,12 @@ abstract class RangeChronologicalPager extends ReverseChronologicalPager { try { if ( $startStamp !== '' ) { $startTimestamp = MWTimestamp::getInstance( $startStamp ); - $startTimestamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) ); $startOffset = $this->mDb->timestamp( $startTimestamp->getTimestamp() ); $this->rangeConds[] = $this->mIndexField . '>=' . $this->mDb->addQuotes( $startOffset ); } if ( $endStamp !== '' ) { $endTimestamp = MWTimestamp::getInstance( $endStamp ); - $endTimestamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) ); $endOffset = $this->mDb->timestamp( $endTimestamp->getTimestamp() ); $this->rangeConds[] = $this->mIndexField . '<=' . $this->mDb->addQuotes( $endOffset ); diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 359eedea78..82bdd843e1 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -64,8 +64,6 @@ class SpecialLog extends SpecialPage { $dateString = $this->getRequest()->getVal( 'wpdate' ); if ( !empty( $dateString ) ) { $dateStamp = MWTimestamp::getInstance( $dateString . ' 00:00:00' ); - $dateStamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) ); - $opts->setValue( 'year', (int)$dateStamp->format( 'Y' ) ); $opts->setValue( 'month', (int)$dateStamp->format( 'm' ) ); $opts->setValue( 'day', (int)$dateStamp->format( 'd' ) );