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

This commit is contained in:
jenkins-bot 2019-10-29 08:45:34 +00:00 committed by Gerrit Code Review
commit 235b238c69
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()