From cddd1a7e75f8677a9819408e0bfb46872b7e206d Mon Sep 17 00:00:00 2001 From: Legoktm Date: Mon, 18 Jun 2018 23:11:17 +0000 Subject: [PATCH] Revert "Use type Language instead of string for $lang of doEditSectionLink" This reverts commit 531e71acdab55df6f567ef43ffaccf4615fe5e66. Was a breaking change that did not following the deprecation policy. Change-Id: Idefd38e1f42ee849a09da0fc5793fb7f051b2a4c --- RELEASE-NOTES-1.32 | 1 - includes/parser/ParserOutput.php | 2 +- includes/skins/Skin.php | 7 +++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 6e823216cf..731f874d16 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -165,7 +165,6 @@ because of Phabricator reports. use 'EditPageGetCheckboxesDefinition' instead. * Linker::getLinkColour() and DummyLinker::getLinkColour(), deprecated since 1.28, were removed. LinkRenderer::getLinkClasses() should be used instead. -* Skin::doEditSectionLink requires type Language for optional parameter $lang. === Deprecations in 1.32 === * Use of a StartProfiler.php file is deprecated in favour of placing diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index ed1dd192eb..265d1516a6 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -314,7 +314,7 @@ class ParserOutput extends CacheTime { return $skin->doEditSectionLink( $editsectionPage, $editsectionSection, $editsectionContent, - $wgLang + $wgLang->getCode() ); }, $text diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 60b702232c..8384ca0c25 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1612,15 +1612,14 @@ abstract class Skin extends ContextSource { * to be included in the link, like "§ion=$section" * @param string $tooltip The tooltip to use for the link: will be escaped * and wrapped in the 'editsectionhint' message - * @param Language|null $lang Language object, defaults to user interface language + * @param string $lang Language code * @return string HTML to use for edit link */ - public function doEditSectionLink( Title $nt, $section, $tooltip = null, Language $lang = null ) { + public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) { // HTML generated here should probably have userlangattributes // added to it for LTR text on RTL pages - global $wgLang; - $lang = $lang ?: $wgLang; + $lang = wfGetLangObj( $lang ); $attribs = []; if ( !is_null( $tooltip ) ) { -- 2.20.1