r110489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110488‎ | r110489 | r110490 >
Date:15:49, 1 February 2012
Author:maxsem
Status:ok (Comments)
Tags:miscextensions 
Comment:
Since feed formats don't have a way to specify error conditions anyway, simply reset invalid language codes to content langauge, which is consistent with index.php behaviour
Modified paths:
  • /trunk/extensions/FeaturedFeeds/ApiFeaturedFeeds.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/ApiFeaturedFeeds.php
@@ -28,8 +28,7 @@
2929
3030 $language = isset( $params['language'] ) ? $params['language'] : false;
3131 if ( $language !== false && !Language::isValidCode( $language ) ) {
32 - wfProfileOut( __METHOD__ );
33 - $this->dieUsage( 'Invalid language code', 'language-invalid' );
 32+ $language = false;
3433 }
3534 $feeds = FeaturedFeeds::getFeeds( $language );
3635 $ourFeed = $feeds[$params['feed']];
@@ -72,7 +71,6 @@
7372 return array(
7473 'feedformat' => 'The format of the feed',
7574 'feed' => 'Feed name',
76 - 'language' => 'Feed language code. Ignored by some feeds.'
7775 );
7876 }
7977

Follow-up revisions

RevisionCommit summaryAuthorDate
r110562Fix r110489, obviously a wrong line was removed.liangent12:47, 2 February 2012

Comments

#Comment by Liangent (talk | contribs)   12:50, 2 February 2012

Actually feed-invalid error in

$this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );

never works. When an invalid feedformat is specified,

<error code="unknown_feedformat" info="Unrecognized value for parameter 'feedformat': invalid" xml:space="preserve">

is raised by API wrapper.

Status & tagging log