From 1bc1d037d4d5018bd032f9c0273aff080dfde014 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Fri, 18 Mar 2016 00:42:14 +0200 Subject: [PATCH] Hopefully fix a MWException on User: pages under MW 1.27alpha Code copypasted from core /includes/skins/BaseTemplate.php, function makeLink(). Totally, completely and absolutely untested, but it makes sense, so it should work....right? Change-Id: I56bc9b62c510bad2d22de149705bb96ffe7aca67 --- TimelessTemplate.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/TimelessTemplate.php b/TimelessTemplate.php index 541347a..d628fbb 100644 --- a/TimelessTemplate.php +++ b/TimelessTemplate.php @@ -255,21 +255,27 @@ class TimelessTemplate extends BaseTemplate { if ( isset( $item['href'] ) ) { $attrs = $item; - foreach ( array( 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary' ) as $k ) { + foreach ( array( 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary', 'tooltip-params' ) as $k ) { unset( $attrs[$k] ); } if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) { $item['single-id'] = $item['id']; } + + $tooltipParams = array(); + if ( isset( $item['tooltip-params'] ) ) { + $tooltipParams = $item['tooltip-params']; + } + if ( isset( $item['single-id'] ) ) { if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) { - $title = Linker::titleAttrib( $item['single-id'] ); + $title = Linker::titleAttrib( $item['single-id'], null, $tooltipParams ); if ( $title !== false ) { $attrs['title'] = $title; } } else { - $tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'] ); + $tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'], $tooltipParams ); if ( isset( $tip['title'] ) && $tip['title'] !== false ) { $attrs['title'] = $tip['title']; }