From 393adfb169a74d1dd8a36cc122b0abf1bb37e585 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 18 Apr 2015 22:35:00 +0200 Subject: [PATCH] Timestamp from Year/Month selector on forms should be wiki time When searching for a year/month with the year/month selector on Special:Contributions or action=history the given time should be treated as wiki time and therefore needs adjust to UTC before search in the Database. This has no effect on wikis with UTC like enwiki, but for example on dewiki with an offset from 1hour/2hour. Change-Id: Iccd41d19a360827b9c80b66582ca0daa7ed7576c --- includes/pager/ReverseChronologicalPager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/pager/ReverseChronologicalPager.php b/includes/pager/ReverseChronologicalPager.php index 4f8c438db0..ee6e26c02f 100644 --- a/includes/pager/ReverseChronologicalPager.php +++ b/includes/pager/ReverseChronologicalPager.php @@ -113,6 +113,10 @@ abstract class ReverseChronologicalPager extends IndexPager { $ymd = 20320101; } - $this->mOffset = $this->mDb->timestamp( "${ymd}000000" ); + // Treat the given time in the wiki timezone and get a UTC timestamp for the database lookup + $timestamp = MWTimestamp::getInstance( "${ymd}000000" ); + $timestamp->setTimeZone( $this->getConfig()->get( 'Localtimezone' ) ); + + $this->mOffset = $this->mDb->timestamp( $timestamp->getTimestamp() ); } } -- 2.20.1