From fb690eeda45cbd26716220772278cc45c1068925 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sat, 20 Apr 2019 17:57:08 +0300 Subject: [PATCH] Remove broken compatibility hack for the legacy SkinTemplateToolboxEnd hook SkinTemplateToolboxEnd hook really shouldn't be used and extensions should have been using BaseTemplateToolbox hook instead, for that hook's been around since MW 1.18. Also this code was broken because $boxes was undefined. Change-Id: I34537e8eb6ec0109253b5470d12d12d86c4dada0 --- includes/TimelessTemplate.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/includes/TimelessTemplate.php b/includes/TimelessTemplate.php index 6ef560d..7b41bec 100644 --- a/includes/TimelessTemplate.php +++ b/includes/TimelessTemplate.php @@ -160,25 +160,6 @@ class TimelessTemplate extends BaseTemplate { $msgString = htmlspecialchars( $msg ); } - // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd - $hookContents = ''; - if ( $name == 'tb' ) { - if ( isset( $boxes['TOOLBOX'] ) ) { - ob_start(); - // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox - // can abort and avoid outputting double toolbox links - // Avoid PHP 7.1 warning from passing $this by reference - $template = $this; - Hooks::run( 'SkinTemplateToolboxEnd', [ &$template, true ] ); - $hookContents = ob_get_contents(); - ob_end_clean(); - if ( !trim( $hookContents ) ) { - $hookContents = ''; - } - } - } - // END hack - $labelId = Sanitizer::escapeId( "p-$name-label" ); if ( is_array( $content ) ) { @@ -192,8 +173,6 @@ class TimelessTemplate extends BaseTemplate { ); } } - // Add in SkinTemplateToolboxEnd, if any - $contentText .= $hookContents; $contentText .= Html::closeElement( 'ul' ); } else { $contentText = $content;