From: Matthew Flaschen Date: Thu, 3 Aug 2017 21:44:49 +0000 (-0400) Subject: Special:Contribs: Ensure 'start' and 'end' are never undefined X-Git-Tag: 1.31.0-rc.0~2479^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=21cc36f87ef64aa992dd08c93edca789715e4bca;p=lhc%2Fweb%2Fwiklou.git Special:Contribs: Ensure 'start' and 'end' are never undefined Bug: T172438 Change-Id: I7359fd489134cb2fff9715af9e675f8cbb706b7a --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 3845649314..1b14fcbe10 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -131,17 +131,14 @@ class SpecialContributions extends IncludableSpecialPage { $skip = $request->getText( 'offset' ) || $request->getText( 'dir' ) == 'prev'; # Offset overrides year/month selection - if ( $skip ) { - $this->opts['year'] = ''; - $this->opts['month'] = ''; - } else { + if ( !$skip ) { $this->opts['year'] = $request->getVal( 'year' ); $this->opts['month'] = $request->getVal( 'month' ); $this->opts['start'] = $request->getVal( 'start' ); $this->opts['end'] = $request->getVal( 'end' ); - $this->opts = ContribsPager::processDateFilter( $this->opts ); } + $this->opts = ContribsPager::processDateFilter( $this->opts ); $feedType = $request->getVal( 'feed' ); diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 6bd7eb0e9f..d7819c42b3 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -583,10 +583,10 @@ class ContribsPager extends RangeChronologicalPager { * @return array Options array with processed start and end date filter options */ public static function processDateFilter( $opts ) { - $start = $opts['start'] ?: ''; - $end = $opts['end'] ?: ''; - $year = $opts['year'] ?: ''; - $month = $opts['month'] ?: ''; + $start = isset( $opts['start'] ) ? $opts['start'] : ''; + $end = isset( $opts['end'] ) ? $opts['end'] : ''; + $year = isset( $opts['year'] ) ? $opts['year'] : ''; + $month = isset( $opts['month'] ) ? $opts['month'] : ''; if ( $start !== '' && $end !== '' && $start > $end ) { $temp = $start;