From: Edward Chernenko Date: Mon, 15 Oct 2018 01:39:29 +0000 (+0300) Subject: Fix warning in doEditSectionLink() caused by not-yet-unstubbed $wgLang X-Git-Tag: 1.34.0-rc.0~3766^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%7Blocalurl:Special:UserLogin%7D%7D?a=commitdiff_plain;h=559b0f3e5487f66556bcedccfc95ad7d6dde4dab;p=lhc%2Fweb%2Fwiklou.git Fix warning in doEditSectionLink() caused by not-yet-unstubbed $wgLang 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 --- diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 6d238caac6..847214a748 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -325,7 +325,6 @@ class ParserOutput extends CacheTime { $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; @@ -334,11 +333,12 @@ class ParserOutput extends CacheTime { 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