In ParserOutput::getText(), $wgLang can be a StubUserLang object,
which causes a typecheck warning in doEditSectionLink().
Solution is to replace $wgLang with $context->getLanguage(),
which is always a Language object.
Change-Id: I9945e1615c3f1b7ed5c7897b9f67d7ca0450ee50
$text = preg_replace_callback(
self::EDITSECTION_REGEX,
function ( $m ) {
- global $wgOut, $wgLang;
$editsectionPage = Title::newFromText( htmlspecialchars_decode( $m[1] ) );
$editsectionSection = htmlspecialchars_decode( $m[2] );
$editsectionContent = isset( $m[4] ) ? Sanitizer::decodeCharReferences( $m[3] ) : null;
throw new MWException( "Bad parser output text." );
}
- $skin = $wgOut->getSkin();
- return $skin->doEditSectionLink( $editsectionPage,
+ $context = RequestContext::getMain();
+ return $context->getSkin()->doEditSectionLink(
+ $editsectionPage,
$editsectionSection,
$editsectionContent,
- $wgLang
+ $context->getLanguage()
);
},
$text