r43617 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43616‎ | r43617 | r43618 >
Date:18:13, 17 November 2008
Author:brion
Status:ok
Tags:
Comment:
* API siteinfo query no longer throws an exception for empty sifilter parameter.

The parameter is defined as being one of two values ('local' or '!local'), but comes back as array() if it was specified but empty... which then got overly-strictly checked against 'false', which was used internally for the case where it's unspecified, and an exception thrown internally.

Now the filter parameter is nicely ignored whether it's unspecified or specified as empty, which is good clear behavior.

As before, other values return a standard API error about invalid values being passed.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -194,7 +194,7 @@
195195 $this->addWhere( 'iw_local = 1' );
196196 elseif( $filter === '!local' )
197197 $this->addWhere( 'iw_local = 0' );
198 - elseif( $filter !== false )
 198+ elseif( $filter )
199199 ApiBase :: dieDebug( __METHOD__, "Unknown filter=$filter" );
200200
201201 $this->addOption( 'ORDER BY', 'iw_prefix' );
Index: trunk/phase3/RELEASE-NOTES
@@ -343,6 +343,7 @@
344344 path naming (/thumbs/hash/file), retired 'apiThumbCacheDir' as a result.
345345 * (bug 5530) Consistency between character encoding in {{PAGENAMEE}},
346346 {{SUBPAGENAMEE}} and {{FULLPAGENAMEE}}
 347+* API siteinfo query no longer throws an exception for empty sifilter parameter.
347348
348349 === API changes in 1.14 ===
349350

Follow-up revisions

RevisionCommit summaryAuthorDate
r43644Fix up r43617: put RELEASE-NOTES entry in the API sectioncatrope21:55, 17 November 2008

Status & tagging log