- if( ( $month = $wgRequest->getIntOrNull( 'month' ) ) !== null && $month !== -1 ) {
- $this->opts['month'] = intval( $month );
- } else {
- $this->opts['month'] = '';
- }
- if( ( $year = $wgRequest->getIntOrNull( 'year' ) ) !== null ) {
- $this->opts['year'] = intval( $year );
- } else if( $this->opts['month'] ) {
- $thisMonth = intval( gmdate( 'n' ) );
- $thisYear = intval( gmdate( 'Y' ) );
- if( intval( $this->opts['month'] ) > $thisMonth ) {
- $thisYear--;
- }
- $this->opts['year'] = $thisYear;
- } else {
- $this->opts['year'] = '';
- }
-