$pageInfo['pagelanguagehtmlcode'] = $pageLanguage->getHtmlCode();
$pageInfo['pagelanguagedir'] = $pageLanguage->getDir();
+ $user = $this->getUser();
+
if ( $titleExists ) {
$pageInfo['touched'] = wfTimestamp( TS_ISO_8601, $this->pageTouched[$pageid] );
$pageInfo['lastrevid'] = (int)$this->pageLatest[$pageid];
$pageInfo['canonicalurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CANONICAL );
}
if ( $this->fld_readable ) {
- $pageInfo['readable'] = $title->userCan( 'read', $this->getUser() );
+ $pageInfo['readable'] = $this->getPermissionManager()->userCan(
+ 'read', $user, $title
+ );
}
if ( $this->fld_preload ) {
$this->countTestedActions++;
if ( $detailLevel === 'boolean' ) {
- $pageInfo['actions'][$action] = $title->userCan( $action, $user );
+ $pageInfo['actions'][$action] = $this->getPermissionManager()->userCan(
+ $action, $user, $title
+ );
} else {
$pageInfo['actions'][$action] = $errorFormatter->arrayFromStatus( $this->errorArrayToStatus(
- $title->getUserPermissionsErrors( $action, $user, $rigor ),
+ $this->getPermissionManager()->getPermissionErrors(
+ $action, $user, $title, $rigor
+ ),
$user
) );
}
*/
private function getTSIDs() {
$getTitles = $this->talkids = $this->subjectids = [];
+ $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
/** @var Title $t */
foreach ( $this->everything as $t ) {
- if ( MWNamespace::isTalk( $t->getNamespace() ) ) {
+ if ( $nsInfo->isTalk( $t->getNamespace() ) ) {
if ( $this->fld_subjectid ) {
$getTitles[] = $t->getSubjectPage();
}
$this->addWhere( $lb->constructSet( 'page', $db ) );
$res = $this->select( __METHOD__ );
foreach ( $res as $row ) {
- if ( MWNamespace::isTalk( $row->page_namespace ) ) {
- $this->talkids[MWNamespace::getSubject( $row->page_namespace )][$row->page_title] =
- (int)$row->page_id;
+ if ( $nsInfo->isTalk( $row->page_namespace ) ) {
+ $this->talkids[$nsInfo->getSubject( $row->page_namespace )][$row->page_title] =
+ (int)( $row->page_id );
} else {
- $this->subjectids[MWNamespace::getTalk( $row->page_namespace )][$row->page_title] =
- (int)$row->page_id;
+ $this->subjectids[$nsInfo->getTalk( $row->page_namespace )][$row->page_title] =
+ (int)( $row->page_id );
}
}
}