} else {
$title = null;
}
+
return $title;
}
}
if ( $this->mOldRestrictions === false ) {
- $this->mOldRestrictions = $dbr->selectField( 'page', 'page_restrictions',
- [ 'page_id' => $this->getArticleID() ], __METHOD__ );
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
+ $linkCache->addLinkObj( $this ); # in case we already had an article ID
+ $this->mOldRestrictions = $linkCache->getGoodLinkFieldObj( $this, 'restrictions' );
}
if ( $this->mOldRestrictions != '' ) {
public function canUseNoindex() {
global $wgExemptFromUserRobotsControl;
- $bannedNamespaces = is_null( $wgExemptFromUserRobotsControl )
- ? MWNamespace::getContentNamespaces()
- : $wgExemptFromUserRobotsControl;
+ $bannedNamespaces = $wgExemptFromUserRobotsControl ?? MWNamespace::getContentNamespaces();
return !in_array( $this->mNamespace, $bannedNamespaces );
}