From 783ea119da95053a4222cf17b8b56008c0ec7df4 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 6 Jun 2011 15:34:14 +0000 Subject: [PATCH] Followup r89564 showsizediff is disabled in miser mode, make the api check and die as appropriate --- includes/api/ApiFeedContributions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index c1e968e064..ef6feccfac 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -54,6 +54,11 @@ class ApiFeedContributions extends ApiBase { $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' ); } + global $wgMiserMode; + if ( $params['showsizediff'] && $wgMiserMode ) { + $this->dieUsage( 'Size difference is disabled in Miser Mode', 'sizediffdisabled' ); + } + $msg = wfMsgForContent( 'Contributions' ); $feedTitle = $wgSitename . ' - ' . $msg . ' [' . $wgLanguageCode . ']'; $feedUrl = SpecialPage::getTitleFor( 'Contributions', $params['user'] )->getFullURL(); @@ -174,7 +179,7 @@ class ApiFeedContributions extends ApiBase { 'tagfilter' => 'Filter contributions that have these tags', 'deletedonly' => 'Show only deleted contributions', 'toponly' => 'Only show edits that are latest revisions', - 'showsizediff' => '', + 'showsizediff' => 'Show the size difference between revisions. Disabled in Miser Mode', ); } @@ -186,6 +191,7 @@ class ApiFeedContributions extends ApiBase { return array_merge( parent::getPossibleErrors(), array( array( 'code' => 'feed-unavailable', 'info' => 'Syndication feeds are not available' ), array( 'code' => 'feed-invalid', 'info' => 'Invalid subscription feed type' ), + array( 'code' => 'sizediffdisabled', 'info' => 'Size difference is disabled in Miser Mode' ), ) ); } -- 2.20.1