API: Fixing a bug that caused inprop=protection to scream when no
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 2 Jul 2007 11:52:14 +0000 (11:52 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 2 Jul 2007 11:52:14 +0000 (11:52 +0000)
existent titles were specified

includes/api/ApiQueryInfo.php

index 715c4a2..f285c72 100644 (file)
@@ -68,7 +68,7 @@ class ApiQueryInfo extends ApiQueryBase {
                $pageLatest = $pageSet->getCustomField('page_latest');
                $pageLength = $pageSet->getCustomField('page_len');
 
-               if ($fld_protection) {
+               if ($fld_protection && count($titles) > 0) {
                        $this->addTables('page_restrictions');
                        $this->addFields(array('pr_page', 'pr_type', 'pr_level', 'pr_expiry'));
                        $this->addWhereFld('pr_page', array_keys($titles));