Index: trunk/phase3/includes/SpecialContributions.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | |
24 | 24 | $this->year = ($year > 0 && $year < 10000) ? $year : false; |
25 | 25 | $this->month = ($month > 0 && $month < 13) ? $month : false; |
26 | | - $this->GetDateCond(); |
| 26 | + $this->getDateCond(); |
27 | 27 | |
28 | 28 | $this->mDb = wfGetDB( DB_SLAVE, 'contributions' ); |
29 | 29 | } |
— | — | @@ -78,6 +78,11 @@ |
79 | 79 | $year_start = $this->year; |
80 | 80 | } else { |
81 | 81 | $year_start = substr( wfTimestampNow(), 0, 4 ); |
| 82 | + $thisMonth = gmdate( 'n' ); |
| 83 | + if( $this->month > $thisMonth ) { |
| 84 | + // Future contributions aren't supposed to happen. :) |
| 85 | + $year_start--; |
| 86 | + } |
82 | 87 | } |
83 | 88 | |
84 | 89 | if ( $this->month ) { |
— | — | @@ -274,7 +279,12 @@ |
275 | 280 | if ( ( $year = $wgRequest->getIntOrNull( 'year' ) ) !== null ) { |
276 | 281 | $options['year'] = intval( $year ); |
277 | 282 | } else if( $options['month'] ) { |
278 | | - $options['year'] = intval( substr( wfTimestampNow(), 0, 4 ) ); |
| 283 | + $thisMonth = intval( gmdate( 'n' ) ); |
| 284 | + $thisYear = intval( gmdate( 'Y' ) ); |
| 285 | + if( intval( $options['month'] ) > $thisMonth ) { |
| 286 | + $thisYear--; |
| 287 | + } |
| 288 | + $options['year'] = $thisYear; |
279 | 289 | } else { |
280 | 290 | $options['year'] = ''; |
281 | 291 | } |