From: Roan Kattouw Date: Thu, 25 Sep 2008 14:50:09 +0000 (+0000) Subject: (bug 15706) Empty values for apprtype and apprlevel are now silently ignored rather... X-Git-Tag: 1.31.0-rc.0~45097 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=352d3f6dfb548c5d3bfdddb40ed9b67abdf69986;p=lhc%2Fweb%2Fwiklou.git (bug 15706) Empty values for apprtype and apprlevel are now silently ignored rather than causing an exception --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0dc5d93cdd..9ea3c29861 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 97f1c39e0a..b0f4759399 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');