];
// Show change protection link
- if ( $this->context->getUser()->isAllowed( 'protect' ) ) {
+ if ( MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->context->getUser(), 'protect' )
+ ) {
$links[] = $linkRenderer->makeKnownLink(
$title,
$this->msg( 'protect_change' )->text(),
public function formatParametersForApi() {
$ret = parent::formatParametersForApi();
if ( isset( $ret['details'] ) && is_array( $ret['details'] ) ) {
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
foreach ( $ret['details'] as &$detail ) {
if ( isset( $detail['expiry'] ) ) {
- $detail['expiry'] = MediaWikiServices::getInstance()->getContentLanguage()->
+ $detail['expiry'] = $contLang->
formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
}
}