if ($this->mResolveRedirects)
$pageFlds['page_is_redirect'] = null;
- return array_keys(array_merge($pageFlds, $this->mRequestedPageFields));
+ $pageFlds = array_merge($pageFlds, $this->mRequestedPageFields);
+ return array_keys($pageFlds);
}
/**
return $linkBatch;
}
- public static function debugPrint($name = 'unknown') {
- ApiBase::debugPrint($this->mAllPages, $name);
- }
-
protected function getAllowedParams() {
return array (
'titles' => array (
private function run($resultPageSet = null) {
+ if ($this->getPageSet()->getGoodTitleCount() == 0)
+ return; // nothing to do
+
$params = $this->extractRequestParams();
$prop = $params['prop'];
}
$title = Title :: makeTitle(NS_CATEGORY, $row->cl_to);
+ // do not check userCanRead() -- page content is already accessible,
+ // and category is listed there.
+
$vals = array();
ApiQueryBase :: addTitleInfo($vals, $title);
if ($fld_sortkey)
$vals['sortkey'] = $row->cl_sortkey;
+
$data[] = $vals;
}
$titles = array();
while ($row = $db->fetchObject($res)) {
- $titles[] = Title :: makeTitle(NS_CATEGORY, $row->cl_to);
+ $title = Title :: makeTitle(NS_CATEGORY, $row->cl_to);
+ if($title->userCanRead())
+ $titles[] = $title;
}
$resultPageSet->populateFromTitles($titles);
}
$pageInfo = array (
'touched' => wfTimestamp(TS_ISO_8601, $pageTouched[$pageid]),
'lastrevid' => intval($pageLatest[$pageid]),
- 'counter' => $pageCounter[$pageid],
- 'length' => $pageLength[$pageid],
+ 'counter' => intval($pageCounter[$pageid]),
+ 'length' => intval($pageLength[$pageid]),
);
if ($pageIsRedir[$pageid])