* API siteinfo query no longer throws an exception for empty sifilter parameter.
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 17 Nov 2008 18:13:11 +0000 (18:13 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 17 Nov 2008 18:13:11 +0000 (18:13 +0000)
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.

RELEASE-NOTES
includes/api/ApiQuerySiteinfo.php

index 5ed09d1..e451dd7 100644 (file)
@@ -343,6 +343,7 @@ The following extensions are migrated into MediaWiki 1.14:
   path naming (/thumbs/hash/file), retired 'apiThumbCacheDir' as a result. 
 * (bug 5530) Consistency between character encoding in {{PAGENAMEE}},
   {{SUBPAGENAMEE}} and {{FULLPAGENAMEE}}
+* API siteinfo query no longer throws an exception for empty sifilter parameter.
 
 === API changes in 1.14 ===
 
index e0d045f..089f471 100644 (file)
@@ -194,7 +194,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        $this->addWhere( 'iw_local = 1' );
                elseif( $filter === '!local' )
                        $this->addWhere( 'iw_local = 0' );
-               elseif( $filter !== false )
+               elseif( $filter )
                        ApiBase :: dieDebug( __METHOD__, "Unknown filter=$filter" );
 
                $this->addOption( 'ORDER BY', 'iw_prefix' );