$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' );
* @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;