Replace all usages of Linker::link() with LinkRenderer

Linker::link was deprected in 1.28. This replaces all usages of
Linker::link with an instance of LinkRenderer in ApiVisualEditor.php, as
this seems to be the only file generating links with Linker::link.

Bug: T149346
Change-Id: Ib395f137787e7dd7c5cfe91905f5feb88ce9f604
This commit is contained in:
jo12bar 2016-12-30 20:37:10 -08:00
parent 2217913182
commit 0533c329fb
No known key found for this signature in database
GPG key ID: A60056C323565303

View file

@ -8,6 +8,8 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
use MediaWiki\MediaWikiServices;
class ApiVisualEditor extends ApiBase {
/**
* @var Config
@ -350,7 +352,9 @@ class ApiVisualEditor extends ApiBase {
// Unfortunately there's no nice way to get only the pages which cause
// editing to be restricted
foreach ( $sources as $source ) {
$notice .= "<li>" . Linker::link( $source ) . "</li>";
$notice .= "<li>" .
MediaWikiServices::getInstance()->getLinkRenderer()->makeLink( $source ) .
"</li>";
}
$notice .= '</ul>';
$notices[] = $notice;
@ -568,9 +572,9 @@ class ApiVisualEditor extends ApiBase {
);
$lp->mLimit = 1;
return $lp->getBody() . Linker::link(
return $lp->getBody() . MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
SpecialPage::getTitleFor( 'Log' ),
$this->msg( 'log-fulllog' )->escaped(),
$this->msg( 'log-fulllog' )->text(),
[],
[
'page' => $title->getPrefixedDBkey(),