aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoan Kattouw <catrope@users.mediawiki.org>2008-09-25 14:50:09 +0000
committerRoan Kattouw <catrope@users.mediawiki.org>2008-09-25 14:50:09 +0000
commit352d3f6dfb548c5d3bfdddb40ed9b67abdf69986 (patch)
tree9eda0990931e666c114acd37665027db8a4add2b
parentb3d5508c103d50dbffc743d5c6efed505038d583 (diff)
downloadmediawikicore-352d3f6dfb548c5d3bfdddb40ed9b67abdf69986.tar.gz
mediawikicore-352d3f6dfb548c5d3bfdddb40ed9b67abdf69986.zip
(bug 15706) Empty values for apprtype and apprlevel are now silently ignored rather than causing an exception
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/41255
-rw-r--r--RELEASE-NOTES2
-rw-r--r--includes/api/ApiQueryAllpages.php7
2 files changed, 6 insertions, 3 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 0dc5d93cdd8c..9ea3c2986117 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -271,6 +271,8 @@ The following extensions are migrated into MediaWiki 1.14:
* action=protect checks for invalid protection types and levels
* (bug 15673) Added indentation to format=wddxfm output and improved built-in
WDDX formatter to resemble PHP's more
+* (bug 15706) Empty values for apprtype and apprlevel are now silently ignored
+ rather than causing an exception
=== Languages updated in 1.14 ===
diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php
index 97f1c39e0aa9..b0f4759399d1 100644
--- a/includes/api/ApiQueryAllpages.php
+++ b/includes/api/ApiQueryAllpages.php
@@ -79,14 +79,15 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
}
// Page protection filtering
- if (isset ($params['prtype'])) {
+ if (!empty ($params['prtype'])) {
$this->addTables('page_restrictions');
$this->addWhere('page_id=pr_page');
$this->addWhere('pr_expiry>' . $db->addQuotes($db->timestamp()));
$this->addWhereFld('pr_type', $params['prtype']);
- $prlevel = $params['prlevel'];
- if (!is_null($prlevel) && $prlevel != '' && $prlevel != '*')
+ // Remove the empty string and '*' from the prlevel array
+ $prlevel = array_diff($params['prlevel'], array('', '*'));
+ if (!empty($prlevel))
$this->addWhereFld('pr_level', $prlevel);
$this->addOption('DISTINCT');