From bbac1831c730b5b733718db86d274d5f830f6c04 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 8 Apr 2008 20:51:19 +0000 Subject: [PATCH] Remove "wtf" $_GET hacks ;) --- includes/LogEventsList.php | 8 ++++++-- includes/SpecialContributions.php | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index e8b7b2e84d..69e54da5de 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -386,8 +386,12 @@ class LogPager extends ReverseChronologicalPager { $this->limitType( $type ); $this->limitUser( $user ); $this->limitTitle( $title, $pattern ); - # Hack to recognize subpage parameter - $_GET['type'] = $type; + } + + function getDefaultQuery() { + $query = parent::getDefaultQuery(); + $query['type'] = $this->type; + return $query; } /** diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 63e14c509d..44df343e54 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -30,6 +30,8 @@ class ContribsPager extends ReverseChronologicalPager { function getDefaultQuery() { $query = parent::getDefaultQuery(); $query['target'] = $this->target; + $query['month'] = $this->month; + $query['year'] = $this->year; return $query; } @@ -279,9 +281,7 @@ function wfSpecialContributions( $par = null ) { wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id ); $wgOut->addHTML( contributionsForm( $options ) ); - # Show original selected options, don't apply them so as to allow paging - $_GET['year'] = ''; // hack for Pager - $_GET['month'] = ''; // hack for Pager + if( $skip ) { $options['year'] = ''; $options['month'] = ''; -- 2.20.1