MtDu has uploaded a new change for review. https://gerrit.wikimedia.org/r/324355
Change subject: Replace Linker::link() usage with LinkRenderer in the following special pages: - SpecialAllPages - SpecialAncientpage - SpecialBlock - SpecialBrokenRedirects - SpecialDoubleRedirects ...................................................................... Replace Linker::link() usage with LinkRenderer in the following special pages: - SpecialAllPages - SpecialAncientpage - SpecialBlock - SpecialBrokenRedirects - SpecialDoubleRedirects Bug: T149346 Change-Id: Ib9997ec29b5c0079acb79dc2772196b38665145d --- M includes/specials/SpecialAllPages.php M includes/specials/SpecialAncientpages.php M includes/specials/SpecialBlock.php M includes/specials/SpecialBrokenRedirects.php M includes/specials/SpecialDoubleRedirects.php 5 files changed, 37 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/324355/1 diff --git a/includes/specials/SpecialAllPages.php b/includes/specials/SpecialAllPages.php index 4a2a619..4b8446a 100644 --- a/includes/specials/SpecialAllPages.php +++ b/includes/specials/SpecialAllPages.php @@ -204,6 +204,7 @@ ] ); + $linkRenderer = $this->getLinkRenderer(); if ( $res->numRows() > 0 ) { $out = Html::openElement( 'ul', [ 'class' => 'mw-allpages-chunk' ] ); @@ -213,7 +214,7 @@ $out .= '<li' . ( $s->page_is_redirect ? ' class="allpagesredirect"' : '' ) . '>' . - Linker::link( $t ) . + $linkRenderer->makeLink( $t ) . "</li>\n"; } else { $out .= '<li>[[' . htmlspecialchars( $s->page_title ) . "]]</li>\n"; @@ -269,6 +270,7 @@ $navLinks = []; $self = $this->getPageTitle(); + $linkRenderer = $this->getLinkRenderer(); // Generate a "previous page" link if needed if ( $prevTitle ) { $query = [ 'from' => $prevTitle->getText() ]; @@ -281,9 +283,9 @@ $query['hideredirects'] = $hideredirects; } - $navLinks[] = Linker::linkKnown( + $navLinks[] = $linkRenderer->makeKnownLink( $self, - $this->msg( 'prevpage', $prevTitle->getText() )->escaped(), + $this->msg( 'prevpage', $prevTitle->getText() )->text(), [], $query ); @@ -304,9 +306,9 @@ $query['hideredirects'] = $hideredirects; } - $navLinks[] = Linker::linkKnown( + $navLinks[] = $linkRenderer->makeKnownLink( $self, - $this->msg( 'nextpage', $t->getText() )->escaped(), + $this->msg( 'nextpage', $t->getText() )->text(), [], $query ); diff --git a/includes/specials/SpecialAncientpages.php b/includes/specials/SpecialAncientpages.php index 9ee1b75..ecc030e 100644 --- a/includes/specials/SpecialAncientpages.php +++ b/includes/specials/SpecialAncientpages.php @@ -78,9 +78,10 @@ $d = $this->getLanguage()->userTimeAndDate( $result->value, $this->getUser() ); $title = Title::makeTitle( $result->namespace, $result->title ); - $link = Linker::linkKnown( + $linkRenderer = $this->getLinkRenderer(); + $link = $linkRenderer->makeKnownLink( $title, - htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) + $wgContLang->convert( $title->getPrefixedText() ) ); return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) ); diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index ce7d24e..585f70b 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -372,12 +372,13 @@ $this->getOutput()->addModuleStyles( 'mediawiki.special' ); + $linkRenderer = $this->getLinkRenderer(); # Link to the user's contributions, if applicable if ( $this->target instanceof User ) { $contribsPage = SpecialPage::getTitleFor( 'Contributions', $this->target->getName() ); - $links[] = Linker::link( + $links[] = $linkRenderer->makeLink( $contribsPage, - $this->msg( 'ipb-blocklist-contribs', $this->target->getName() )->escaped() + $this->msg( 'ipb-blocklist-contribs', $this->target->getName() )->text() ); } @@ -392,21 +393,24 @@ $message = $this->msg( 'ipb-unblock' )->parse(); $list = SpecialPage::getTitleFor( 'Unblock' ); } - $links[] = Linker::linkKnown( $list, $message, [] ); + $links[] = $linkRenderer->makeKnownLink( + $list, + new HtmlArmor( $message ) + ); # Link to the block list - $links[] = Linker::linkKnown( + $links[] = $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'BlockList' ), - $this->msg( 'ipb-blocklist' )->escaped() + $this->msg( 'ipb-blocklist' )->text() ); $user = $this->getUser(); # Link to edit the block dropdown reasons, if applicable if ( $user->isAllowed( 'editinterface' ) ) { - $links[] = Linker::linkKnown( + $links[] = $linkRenderer->makeKnownLink( $this->msg( 'ipbreason-dropdown' )->inContentLanguage()->getTitle(), - $this->msg( 'ipb-edit-dropdown' )->escaped(), + $this->msg( 'ipb-edit-dropdown' )->text(), [], [ 'action' => 'edit' ] ); diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index 1753396..6646e0e 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -109,12 +109,13 @@ } } + $linkRenderer = $this->getLinkRenderer(); // $toObj may very easily be false if the $result list is cached if ( !is_object( $toObj ) ) { - return '<del>' . Linker::link( $fromObj ) . '</del>'; + return '<del>' . $linkRenderer->makeLink( $fromObj ) . '</del>'; } - $from = Linker::linkKnown( + $from = $linkRenderer->makeKnownLink( $fromObj, null, [], @@ -128,14 +129,14 @@ // check, if the content model is editable through action=edit ContentHandler::getForTitle( $fromObj )->supportsDirectEditing() ) { - $links[] = Linker::linkKnown( + $links[] = $linkRenderer->makeKnownLink( $fromObj, - $this->msg( 'brokenredirects-edit' )->escaped(), + $this->msg( 'brokenredirects-edit' )->text(), [], [ 'action' => 'edit' ] ); } - $to = Linker::link( + $to = $linkRenderer->makeLink( $toObj, null, [], @@ -147,9 +148,9 @@ $out = $from . $this->msg( 'word-separator' )->escaped(); if ( $this->getUser()->isAllowed( 'delete' ) ) { - $links[] = Linker::linkKnown( + $links[] = $linkRenderer( $fromObj, - $this->msg( 'brokenredirects-delete' )->escaped(), + $this->msg( 'brokenredirects-delete' )->text(), [], [ 'action' => 'delete' ] ); diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index 0cec9d0..9140bf1 100644 --- a/includes/specials/SpecialDoubleRedirects.php +++ b/includes/specials/SpecialDoubleRedirects.php @@ -137,14 +137,15 @@ $result = $dbr->fetchObject( $res ); } } + $linkRenderer = $this->getLinkRenderer(); if ( !$result ) { - return '<del>' . Linker::link( $titleA, null, [], [ 'redirect' => 'no' ] ) . '</del>'; + return '<del>' . $linkRenderer->makeLink( $titleA, null, [], [ 'redirect' => 'no' ] ) . '</del>'; } $titleB = Title::makeTitle( $result->nsb, $result->tb ); $titleC = Title::makeTitle( $result->nsc, $result->tc, '', $result->iwc ); - $linkA = Linker::linkKnown( + $linkA = $linkRenderer->makeKnownLink( $titleA, null, [], @@ -158,26 +159,24 @@ // check, if the content model is editable through action=edit ContentHandler::getForTitle( $titleA )->supportsDirectEditing() ) { - $edit = Linker::linkKnown( + $edit = $linkRenderer->makeKnownLink( $titleA, - $this->msg( 'parentheses', $this->msg( 'editlink' )->text() )->escaped(), + $this->msg( 'parentheses', $this->msg( 'editlink' )->text() )->text(), [], - [ - 'action' => 'edit' - ] + [ 'action' => 'edit' ] ); } else { $edit = ''; } - $linkB = Linker::linkKnown( + $linkB = $linkRenderer->makeKnownLink( $titleB, null, [], [ 'redirect' => 'no' ] ); - $linkC = Linker::linkKnown( $titleC ); + $linkC = $linkRenderer->makeKnownLink( $titleC ); $lang = $this->getLanguage(); $arr = $lang->getArrow() . $lang->getDirMark(); -- To view, visit https://gerrit.wikimedia.org/r/324355 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9997ec29b5c0079acb79dc2772196b38665145d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MtDu <justin.d...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits