From: umherirrender Date: Sat, 18 Apr 2015 20:35:00 +0000 (+0200) Subject: Timestamp from Year/Month selector on forms should be wiki time X-Git-Tag: 1.31.0-rc.0~11392^2 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=393adfb169a74d1dd8a36cc122b0abf1bb37e585;p=lhc%2Fweb%2Fwiklou.git 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 --- 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() ); } }