Drop use of wgParser, replaced in 1.32 and to be removed in 1.35

Bug: T160811
Change-Id: Id7332a19d64d83bcbccfd3ac89464dfea593cdc2
This commit is contained in:
James D. Forrester 2019-10-28 20:10:07 +00:00
parent a5eb16f681
commit 2479f5c7f8
2 changed files with 1 additions and 3 deletions

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgParser" />
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
</rule>

View file

@ -407,8 +407,7 @@ class ApiVisualEditor extends ApiBase {
if ( $params['editintro'] ) {
$eiTitle = Title::newFromText( $params['editintro'] );
if ( $eiTitle instanceof Title && $eiTitle->exists() && $eiTitle->userCan( 'read' ) ) {
global $wgParser;
$notices[] = $wgParser->parse(
$notices[] = MediaWikiServices::getInstance()->getParser()->parse(
'<div class="mw-editintro">{{:' . $eiTitle->getFullText() . '}}</div>',
$title,
new ParserOptions()