X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedContributions.php;h=cae1e150eee0441fdc63aeb0fd9799794225e58f;hb=802c199d0bd80ff0f4d730c61fd58cbf08a52d8d;hp=c7dc303ada45ab6f66362192f3f7d70b16ad2d09;hpb=52fc0648f87e5b8b917a7780030a3eec02f16a43;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index c7dc303ada..cae1e150ee 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -43,16 +43,16 @@ class ApiFeedContributions extends ApiBase { $config = $this->getConfig(); if ( !$config->get( 'Feed' ) ) { - $this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' ); + $this->dieWithError( 'feed-unavailable' ); } $feedClasses = $config->get( 'FeedClasses' ); if ( !isset( $feedClasses[$params['feedformat']] ) ) { - $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' ); + $this->dieWithError( 'feed-invalid' ); } if ( $params['showsizediff'] && $this->getConfig()->get( 'MiserMode' ) ) { - $this->dieUsage( 'Size difference is disabled in Miser Mode', 'sizediffdisabled' ); + $this->dieWithError( 'apierror-sizediffdisabled' ); } $msg = wfMessage( 'Contributions' )->inContentLanguage()->text(); @@ -70,11 +70,16 @@ class ApiFeedContributions extends ApiBase { $feedUrl ); + // Convert year/month parameters to end parameter + $params['start'] = ''; + $params['end'] = ''; + $params = ContribsPager::processDateFilter( $params ); + $pager = new ContribsPager( $this->getContext(), [ 'target' => $target, 'namespace' => $params['namespace'], - 'year' => $params['year'], - 'month' => $params['month'], + 'start' => $params['start'], + 'end' => $params['end'], 'tagFilter' => $params['tagfilter'], 'deletedOnly' => $params['deletedonly'], 'topOnly' => $params['toponly'],