From 4c54e4016f641a603bd47f27b600aaf28d7187d1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 17 Nov 2008 18:13:11 +0000 Subject: [PATCH] * 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. --- RELEASE-NOTES | 1 + includes/api/ApiQuerySiteinfo.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5ed09d1409..e451dd7d5a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index e0d045fa6b..089f4712ac 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -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' ); -- 2.20.1